[chef] Help understanding environment cookbook pattern, and how to generate it?


Chronological Thread 
  • From: "Fouts, Chris" < >
  • To: " " < >
  • Subject: [chef] Help understanding environment cookbook pattern, and how to generate it?
  • Date: Thu, 12 Feb 2015 20:51:59 +0000
  • Accept-language: en-US

We are using Chef 12 Enterprise, and have different organizations setup for development and QA.

We want to adapt to the Berkshelf way of managing cookbooks. The workflow puts a lot of emphasis on the "environment" cookbook, and I read numerous articles and watch numerous videos about it.

http://misheska.com/blog/2013/06/16/getting-started-writing-chef-cookbooks-the-berkshelf-way/
http://blog.vialstudios.com/the-environment-cookbook-pattern/
http://www.hurryupandwait.io/blog/chef-cookbook-dependency-management-and-the-environment-cookbook-pattern
http://bytearrays.com/manage-chef-cookbooks-organization-repo/

...and many more.

However, the concept of environment cookbook still eludes me. Can you please shed some light?

Say I have a product that has two VMs, a Web VM and a Router VM. Say I have the following cookbooks, (each cookbook is in its own repo and downloaded to the workstation)

.berkshelf/default/cookbooks/java
.berkshelf/default/cookbooks/apache
.berkshelf/default/cookbooks/web-appl
.berkshelf/default/cookbooks/iprouter-appl

My Web box needs these
.berkshelf/default/cookbooks/java
.berkshelf/default/cookbooks/apache
.berkshelf/default/cookbooks/web-appl

My Router box needs these
.berkshelf/default/cookbooks/java
.berkshelf/default/cookbooks/iprouter-appl

I want to setup "dev" and "qa" environments so I can control the versions I want for all the above cookbooks in each environment.

Where does the environment cookbook come into play?

Should I have the following environment cookbooks (I inferred this from this link http://bytearrays.com/manage-chef-cookbooks-organization-repo) which says environment cookbooks ” Represent a whole node to be installed/managed”
- web-dev
- web-qa
- router-dev
- router-qa

If so, what would above cookbook's metadata.rb and Berkshelf.lock file look like?

Chris

 




Archive powered by MHonArc 2.6.16.

§