If i have a a software system that has a lot of dependencies on other libraries, like libssl, or libxml etc, should I be creating separate cookbooks for each of these libraries (with a recipe that really only has like 2 lines) or do people do several 'package' blocks in a cookbook to ensure the dependencies are there (and not split out these package blocks to their external cookbooks)?
|
|
As CS3 said it really isn't practical to have hundreds of cookbooks just to end up installing one application. Chef actually uses your system's package manager and can automatically resolve the dependencies for you. The only reason you would want to split off a dependency is if you have some specific configuration items that may change across systems, or may vary based on the package that depends on it. |
|||
|
|
|
If you only need to install package dependecies, you can do something simple like this:
Or you can even create an attribute and iterate through those. attributes/default.rb:
recipes/deps.rb:
The second way will allow you to update the package list via overrides. You can even add this to a seperate recipe in your cookbook that you can add to the bootstrap run_list, or the application role. |
|||
|
|