Day 47: Bootstrapping the Chef Client onto a Linux Host

In last week’s post, Setting up a Chef Workstation, we demonstrated how to setup a Chef Workstation on Ubuntu 12.04 so that you can manage both your Chef Server and the Hosts that are being managed by it.

 

Before you begin, please note that if you attempting to bootstrap a client that was previously managed by another Chef Server, you will probably want to do the following:

1. Remove the previous Chef-Client on the Host.
2. Remove any configuration files from on the Host where the Chef-Client was installed:

 

 

Bootstrapping the Chef-Client onto Ubuntu 12.04

Run the following command from your Chef Workstation to install the Chef Client. Before you run the command, make sure you are in the chef-repo directory or else the knife command will not be able to find its related configuration file.

 

A breakdown of the syntax above is detailed below:

SERVER_NAME = The Name of your Linux Host (FQDN works as well here)
username = local username account on the host
password = password for the username provided

Another way of stating what the command above is doing is adding the Host to the Chef Server as a Node using sudo rights to do so.

 

A sample command of what the syntax can look like in your environment is provided below:

 

Note, that at the time of this post, you will have to have root access on the Host you want to manage in order to install and manage the Chef Client.

Once the Chef Client has been installed, you can login to your Chef Server, and view the added Host under the Status section.

 

temp

 

From your Chef Workstation, you can also verify that the client installation was successful by running one of the following three command(s):

 

The output from each of these commands should include the Linux Host that you just added the Chef Client to.

 

 

Conclusion

This week’s post has demonstrated how to install the Chef Client on a Linux Host and verify that it is able to communicate with your Chef Server. In next weeks post, we’ll demonstrate how to add a Windows Host into Chef.

 

Previous Installments

100 Days of DevOps with PowerShell

 

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.