rcbops-cookbooks/osops-utils — pull request #113 by mancdaz (2013-07-12 12:44:20+00:00)
Title: add package install recipes to be included by other recipes that need to install those packages

The right way to perform repeatable actions in chef is to write the action into a recipe, and then include that recipe. This ensures that we are not then introducing resource cloning by defining an action/resource in multiple places.

Where we need to install the same package from multiple cookbooks/recipes (for eg python-keystone is needed by nova and horizon), then we need a recipe that will install that package that can be included.

We could have a single recipe that installs all 'common' packages, but picking a single set of common packages that gets installed everywhere may not suit everyones needs. Doing it this way means we have granularity down to the package level.

Yes, chef should just take care of this itself. But it doesn't.

Note: this reduces all chef-client run times because there are some packages that will have been attempted to be installed by about 5 cookbooks. In the old world, there would actually be 5 attempts to 'apt-get' or 'yum' install the package, and whilst minimal, this does add up.