Chef - Workstation Setup


Chef follows the concept of client-server architecture, hence in order to start working with Chef one needs to set up Chef on the workstation and develop the configuration locally. Later it can be uploaded to Chef server to make them working on the Chef nodes, which needs to be configured.

Opscode provides a fully packaged version, which does not have any external prerequisites. This fully packaged Chef is called the omnibus installer.

On Windows Machine

Step 1 − Download the setup .msi file of chefDK on the machine.

Step 2 − Follow the installation steps and install it on the target location.

The setup will look as shown in the following screenshot.

Window Setup

ChefDK Path Variable

$ echo $PATH 

On Linux Machine

In order to set up on the Linux machine, we need to first get curl on the machine.

Step 1 − Once curl is installed on the machine, we need to install Chef on the workstation using Opscode’s omnibus Chef installer.

$ curl –L | sudo bash 

Step 2 − Install Ruby on the machine.

Step 3 − Add Ruby to path variable.

$ echo ‘export PATH = ”/opt/chef/embedded/bin:$PATH”’ ≫ ~/.bash_profile && 
source ~/.bash_profile 

The Omnibus Chef will install Ruby and all the required Ruby gems into /opt/chef/embedded by adding /opt/chef/embedded/bin directory to the .bash_profile file.

If Ruby is already installed, then install the Chef Ruby gem on the machine by running the following command.

$ gem install chef