Skip to end of metadata
Go to start of metadata

Workflows

Combined chef / cookbook repo

In this workflow, cookbooks are contained within the same repo as the rest of your chef configuration (roles, data bags, environments etc). This workflow makes it easy to manage a single chef instance, however it makes it difficult to collaborate with others on cookbooks, as in order to do so, you would need to share your entire chef repo (often containing data specific to only your environment). The simplest way for installing cookbooks with this method is to use `knife cookbook site vendor <cookbook name> to install cookbooks from the community site into your repo.

One git repository containing all cookbooks

Keeping all cookbooks within one repo keeps the management of the cookbooks simple, and allows for a large number of private cookbooks to be stored on a service like github without the cost of multiple private repositories. The simplest way for installing cookbooks with this method is to use `knife cookbook site vendor <cookbook name> to install cookbooks from the community site into your cookbooks repo. Note that if you use existing cookbooks from the Community site or github, moving them into your cookbooks repository will make it difficult to push your changes back to the community, and having all of your custom cookbooks in this same repository will make it more difficult for others to collaborate on them using a typical github workflow.

One git repository per cookbook

For developing cookbooks, this is the simplest workflow, as it allows for cookbook forking, pull requests and other tools with services like github. Without using tools to manage the individual cookbooks (like sub-modules or Librarian) this workflow become cumbersome quickly and would be hard to keep in sync between workstations and users.

Cookbooks as git sub-modules

A solution to the 'one git repository per cookbook' issue with keeping cookbooks in sync is to use git submodules to point to each individual git repo. This makes it simpler to keep all of your individual cookbook git repos in sync by simply pointing to each repo using a submodule. The submodules can all be stored within a single cookbooks repository, making sharing that repository simple while still gaining the collaborative advantages of having an individual git repo for each cookbook.

Librarian

Librarian is a tool for managing cookbooks which is analogous to Bundler's 'Gemfile' for ruby gems. A Librarian 'Cheffile' can be configured to point to cookbooks on the Opscode community site, individual git repos, or even cookbooks embedded within larger git repos. As the Cheffile can be checked into version control in your chef-repo, sharing the state of your repo's cookbooks directory becomes simplified, and you can easily use cookbooks from a combination of sources.

Use cases

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.