Handling dependencies
A very nifty feature of Chef is the ability to include recipes from one cookbook with another. This way, we can create cookbooks with a purpose, like a product or an end result. An example of such a cookbook could be an application cookbook named MyCloudApp, with calls to, or inclusions of, other cookbooks such as Apache, MySQL, or any other cookbook it might need.
Until now, we added recipe after recipe to the run list of our host. This is not optimal, and less than desirable when managing a lot of nodes. The idea here is to create a new cookbook dedicated to an imaginary MySite application, that will reference and depend on all the other recipes, so we can only load this MySite cookbook and be done with it.
Getting ready
To work through this recipe, you will need the following:
A working Chef DK installation on the workstation
A working Chef client configuration on the remote host
Optionally, the Chef code from the previous recipes
How to do it…
We know we want to create...