Information Technology Reference
In-Depth Information
Test Kitchen and Chef Zero
Generate a cookbook named zero with chef generate cookbook or knife cookbook
create , depending on whether you are using the Chef Development Kit or the Chef Client
respectively. Also, enable the cookbook to use Test Kitchen. We're going to go through the
cookbook creation steps quickly in this chapter. If you need a refresher on what each of these
commands mean and the expected output, refer back to Chapter 7 .
Chef Development Kit:
$ chef generate cookbook zero
$ cd zero
Chef Client:
$ knife cookbook create zero --cookbook-path .
$ cd zero
$ kitchen init --create-gemfile
$ bundle install
Edit the provisioner: stanza in the generated .kitchen.yml to use chef_zero . As of this
writing, chef_zero is not the default provisioner, but it might be by the time you read this.
Also, edit the .kitchen.yml file to use the CentOS 6.5 basebox we prepared specifically for
this topic. Next, assign a private network address like we did in Chapter 7 . This time, we're
going to use the IP address 192.168.33.34. If this conflicts with an address already being
used on your local network, change it to be a nonconflicting one.
Example 11-1. chefdk/zero/.kitchen.yml
---
driver :
name : vagrant
provisioner :
name : chef_zero
platforms :
- name : centos65
driver :
box : learningchef / centos65
box_url : learningchef / centos65
Search WWH ::




Custom Search