Information Technology Reference
In-Depth Information
Chapter 11. Chef Zero
Wouldn't it be nice to be able to spin up a Chef Server locally using a smaller memory foot-
simulate a production Chef Server environment is a lot to ask. The Chef Development Kit
and Chef Client just so happen to include a stripped-down version of Chef Server for this
very purpose, called
chef-zero
.
chef-zero
runs comfortably in as little as 20 MB of memory. Because it is small, it also
starts up quickly, which is great for testing. In order to fit into such a small memory foot-
print,
chef-zero
sacrifices a few things. There is no web UI, nor is there any persistence;
once Chef Zero is stopped, all data is lost. Neither of these two things is needed for testing.
Test Kitchen provides built-in support for
chef-zero
. Let's go through a simple example of
how you can use
chef-zero
with Test Kitchen. It's great for testing your cookbook in a
sandbox environment with
chef-client
using
chef-zero
as a simulated Chef Server, so
you can test cookbooks that exploit Chef Server-specific features. We'll be covering more of
these server-specific features in the remainder of this topic, so having a nimbler test environ-
ment available will be handy.
For those using Chef Client, you will need to install an additional gem to use Chef Zero. Run the
following command to install
chef-zero
:
$
sudo gem install chef-zero --no-ri --no-rdoc
If you're using the Chef Development Kit, you're fine, this Ruby gem has already been installed
for you.