Skip to content

Instantly share code, notes, and snippets.

@lowkeyshift
Created April 11, 2018 23:53
Show Gist options
  • Save lowkeyshift/834e667345adac2bf9197e97f85f81e3 to your computer and use it in GitHub Desktop.
Save lowkeyshift/834e667345adac2bf9197e97f85f81e3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Installing Packages
sudo apt-get update -y -qq && sudo apt-get -y -q install linux-headers-$(uname -r) build-essential && \
wget -P /tmp https://packages.chef.io/stable/ubuntu/14.04/chef-server-core_12.11.1-1_amd64.deb && \
dpkg -i /tmp/chef-server-core_12.11.1-1_amd64.deb
sudo chown -R vagrant:vagrant /home/vagrant && mkdir /home/vagrant/certs
sudo chef-server-ctl reconfigure
printf "\033c"
sudo chef-server-ctl user-create testlabdev Test Lab testlab@testlab.com password --filename /home/vagrant/certs/testlabdev.pem
sudo chef-server-ctl org-create testcheflab "Test Chef Lab" --association_user testlabdev --filename /home/vagrant/certs/testcheflab.pem
sudo chef-server-ctl install chef-manage
sudo chef-server-ctl reconfigure
sudo chef-manage-ctl reconfigure --accept-license
sudo chef-server-ctl install opscode-reporting
sudo chef-server-ctl reconfigure
sudo opscode-reporting-ctl reconfigure --accept-license
# configure hosts file for our internal network defined by Vagrantfile
cat >> /etc/hosts <<EOL
# vagrant environment nodes
10.0.15.10 chef-server
10.0.15.15 lb
10.0.15.22 web1
10.0.15.23 web2
EOL
printf "\033c"
echo "Chef Console is ready: http://chef-server with login: testlabdev password: password"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment