Information Technology Reference
In-Depth Information
If you're using the Chef Development Kit, you're fine, these Ruby gems have already been
installed for you.
Revisiting the Apache Cookbook
For people new to automated testing, Serverspec is the most easily understood tool, so we'll
start with it first. We will test it by revisiting a cookbook we created in Chapter 7 . We'll be
adding tests to this cookbook in this chapter.
NOTE
We are covering Serverspec v2 syntax.
Generate a cookbook called apache-test .
Chef Development Kit:
$ chef generate cookbook apache-test
$ cd apache-test
Chef Client:
$ knife cookbook create apache-test --cookbook-path .
$ cd apache-test
$ kitchen init --create-gemfile
$ bundle install
Edit the .kitchen.yml as shown in Example 16-1 . Use the chef_zero provisioner and our fa-
vorite basebox image. Additionally, configure a private_network with an IP address of
192.168.33.38 so you can access the website from your host development workstation like
you did in Chapter 7 .
Example 16-1. chefdk/apache-test/.kitchen.yml
---
driver :
name : vagrant
Search WWH ::




Custom Search