Shrinath
Shrinath

Reputation: 8118

Berkshelf: Merging multiple cookbooks with same name for opsworks

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:

  1. Built-in cookbooks.
  2. Berkshelf cookbooks, if any.
  3. 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

Answers (1)

tarky
tarky

Reputation: 481

Virtualizing AWS OpsWorks on Local Vagrant might be help.

Upvotes: -1

Related Questions