Setup Chef Workstation on Microsoft Azure
If you do not know how Chef helps with DevOps, I recommend you to watch this conversion https://channel9.msdn.com/events/Seth-on-the-Road/That-Conference-2015/T009, between Matt Stratton, Senior Solutions Architect at Chef and Seth Juarez, Senior Technical Evangelist on the Channel 9 team.
There are lots of tutorials and learning guides available for Chef (https://learn.chef.io/). For all my learnings, I completely depend on virtual machines on cloud, unless there is a specific need or limitation to use an on-premise VM. So when I was going through the Chef tutorials, I had to accommodate some changes based on Azure environment. I am documenting my experiments with Chef on Azure in this series of blog posts.
- Microsoft Azure Subscription
- Git Bash Shell
Create a Virtual Machine for Chef Workstation
Navigate to https://manage.windowsazure.com/ on browser
Click on the +NEW link at the bottom-left corner of the screen.
Click COMPUTE, then VIRTUAL
MACHINE, then FROM GALLERY
Click UBUNTU, then Ubuntu Server 14.04 LTS, then next arrow
Specify virtual machine configuration and click next. Note that I have used ‘mme-chef-ws’ as the name of virtual machine for Chef Workstation. This name will be used in later steps. Change it according to your environment. Also, for simplicity, I have chosen password option instead of SSH key for the VM.
Change virtual machine configuration if required. Add HTTP endpoint to the endpoints (we enable web server as part of chef learning later), and click next
Wait for the created virtual machine to be in running state.
Install Chef Development Kit
The Chef Development Kit (ChefDK) brings the best-of-breed development tools built by the awesome Chef community. Actual download site is https://downloads.chef.io/chef-dk/. However, I have followed steps in another tutorial provided by Chef.
Open Git Bash on your computer and connect to the Chef workstation. Note down the DNS name of virtual machine from the virtual machine details (above picture). Connect to the virtual machine by running the command ‘ssh firstname.lastname@example.org’
Run the command (curl -L http://www.getchef.com/chef/install.sh | sudo bash) to install chef client and tools on workstation.
Learn Chef Basics on Ubuntu
Now the workstation is ready for us to learn the basics of Chef. Now we can follow the tutorial provided on Chef learning site on this virtual machine.
- Configure a resource – https://learn.chef.io/learn-the-basics/ubuntu/configure-a-resource/
- Configure a package and service – https://learn.chef.io/learn-the-basics/ubuntu/configure-a-package-and-service/
- Making recipe more manageable – https://learn.chef.io/learn-the-basics/ubuntu/make-your-recipe-more-manageable/
Next, I will try out configuring Chef Server and node on Azure.