Reputation: 8118
I am trying to emulate Opsworks deployment on Vagrant using AWS cookbooks and Berkshelf. Quoting from AWS doc here -
For Chef 11.10 stacks, after AWS OpsWorks installs the built-in, custom, and Berkshelf cookbooks, it merges them to a common directory in the following order:
- Built-in cookbooks.
- Berkshelf cookbooks, if any.
- Custom cookbooks, if any.
When AWS OpsWorks performs this merge, it copies the entire contents of the directories, including recipes. If there are any duplicates, the following rules apply:
- The contents of Berkshelf cookbooks take precedence over the built-in cookbooks.
- The contents of custom cookbooks take precedence over the Berkshelf cookbooks.
To illustrate how this process works, consider the following scenario, where all three cookbook directories include a cookbook named mycookbook:
- Built-in cookbooks – mycookbook includes an attributes file named someattributes.rb, a template file named sometemplate.erb, and a recipe named somerecipe.rb.
- Berkshelf cookbooks – mycookbook includes sometemplate.erb and somerecipe.rb.
- Custom cookbooks – mycookbook includes somerecipe.rb.
The merged cookbook contains the following:
- someattributes.rb from the built-in cookbook.
- sometemplate.erb from the Berkshelf cookbook.
- somerecipe.rb from the custom cookbook.
Now, Is there a clean way of doing this in local vagrant? Berkshelf or otherwise? What directory structure do people follow and how do they merge while testing locally?
Upvotes: 1
Views: 591