Project: Building a Chef 12 Server on DigitalOcean
-
Downloading Chef 12.1.2 now.
-
Install command:
sudo dpkg -i chef-server-core_12.1.2-1_amd64.deb
-
There was a warning in the DO instructions here: This will install the base Chef 12 system onto the server. If you have selected a server with less powerful hardware than the recommended amount, this step may fail.
But even on this little single core, 1GB RAM Droplet everything appears to have gone smoothly, no errors were generated.
-
I always add a few extra packages of my own:
sudo apt-get install htop sysstat fail2ban
-
Turn on SAR data collection:
sudo vi /etc/default/sysstat
Set the value of ENABLED to true.
-
Because we are creating an instance that is so tiny and tight on resources, it would be smart to set up some swap space right from the beginning to make sure that we are as well situated as possible. This is a pretty standard procedure but DigitalOcean actually has a specific How To made for this specific to Ubuntu 14.04.
https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
sudo fallocate -l 3G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile
-
You will want to make that swap file permanent too:
echo "/swapfile none swap sw 0 0" >> /etc/fstab
-
Next up, reconfiguring chef:
sudo chef-server-ctl reconfigure
This step takes several minutes to run, so don't be surprised.
-
Now it is time to create an admin user. Of course, you will need to modify this command for your own purposes.
chef-server-ctl user-create USERNAME FIRST_NAME LAST_NAME EMAIL PASSWORD
-
This last step will output a private key. Make sure to save this before going on to do anything else.
-
Now to make our first organization, we will make a test one to get started.
chef-server-ctl org-create SHORTNAME LONGNAME --association_user USERNAME -f filename
That's the format, here is a real command:
chef-server-ctl org-create test "Chef Testing NonProd" --association_user scott -f scott.pem