Information Technology Reference
In-Depth Information
Figure 7-1. Anatomy of a Chef run
In the case of Test Kitchen, the run list is specified in the .kitchen.yml file and passed to
chef-client on the command line via the -o parameter. In production, the run list is main-
tained on Chef Server as a node attribute.
We've just described how a Chef run works in more detail when you run kitchen con-
verge . Now, let's also cover the structure of a cookbook in more detail.
Cookbook Structure
A Chef cookbook is expected to have a specific file and directory structure. You could create
these files and directories by hand with your editor and filesystem, but most people find it
convenient to use the scaffolding generators Chef provides to lay down the directory struc-
ture: chef generate cookbook or knife cookbook create .
A basic cookbook directory structure contains the following files:
cookbook
├── .kitchen.yml
├── README.md
├── attributes
│ └── default/
├── chefignore
├── files/
│ └── default/
├── metadata.rb
├── recipes/
│ └── default.rb
└── templates/
└── default/
\.kitchen.yml
The .kitchen.yml file is a YAML-format configuration file for Test Kitchen. You can use
Test Kitchen to create sandbox environments to verify and validate your cookbook while
you develop it.
Search WWH ::




Custom Search