Bootstrapping a Chef Client

Installing Chef as client is a fairly straight forward thing to do after you already have your Chef Server setup. Heres a brief overview of the key steps you will need to take.

First you will need to install Chef Client. You can do that by following this link. This will take you to the Opscode page that helps you figure out what you need and gives you options on how to actually get the chef-client package.
For my case since I am running CentOS 6 I chose Enterprise Linux 6 on a 64-Bit platform. The command that the page gave me to use was:

curl -L | bash

From here you log in as your root user and run the command. As a side note I tried this using just my sudo user and it did not work because for some reason it could not create a lock file. Here is what my error looked like:

 to file /tmp/
trying wget...
md5 3fe6dd8e19301b6c66032496a89097db
sha256 edd5d2bcc174f67e5e5136fd7e5fffd9414c5f4949c68b28055b124185904d9f
downloaded metadata file looks valid...
 to file /tmp/
trying wget...
Checksum compare with sha256sum succeeded.
Installing Chef 
installing with rpm...
warning: /tmp/ Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
Installation failed
Please file a bug report at
Project: Chef
Component: Packages
Label: Omnibus
Please detail your operating system type, version and any other relevant details

Once I tried it again as the actual root user everything worked fine.

And now on to the good stuff…

On your master you need to “create the client”

sudo knife bootstrap --sudo -x seth -N "centos-lab-001"

and you will see something like this…

[sudo] password for seth:
Bootstrapping Chef on
Enter your password: Starting Chef Client, version 11.6.0 Creating a new client identity for centos-lab-001 using the validator key. resolving cookbooks for run list: [] Synchronizing Cookbooks: Compiling Cookbooks... [2014-03-20T22:03:29-04:00] WARN: Node centos-lab-001 has an empty run list. Converging 0 resources Chef Client finished, 0 resources updated

Once this has completed you will need to log into either your on Chef server or as I do, my Opscode hosted management page at Once you have connected go to your Node tab at the top and then click Edit next to your new node that you should see here. From here you will see your available recipes on the left and Run List on the right. What you want to do is click and drag a name of a recipe over to the right to your run list. An easy one to test with is NTP which you can get from the Opscode community or on Github. Once you have done this save and open a terminal to your new node.


sudo chef-client

and you should see a bunch of stuff scroll by and then a success message.

This is a VERY brief guide and there are much more detailed  descriptions of this process that can be found out there. Good luck and feel free to ask questions in the comments or tweet me @devopshomelab

2 thoughts on “Bootstrapping a Chef Client”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s