I've got a Chef project that, locally with Vagrant, works really nicely. I'm using librarian-chef
, which means I can specify my dependencies in a Cheffile
like this:
site 'http://community.opscode.com/api/v1'
cookbook 'jenkins'
When I then run librarian-chef install
, it pulls down jenkins
and all the cookbooks it depends on into a cookbooks
directory.
There's also another directory, site-cookbooks
, which is where I'm writing all of my own custom cookbooks and recipes.
In the Vagrantfile
, you can then tell it to look at two different paths for cookbooks:
config.vm.provision "chef_solo" do |chef|
chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
# snip
end
This works perfectly when I run vagrant up
. However, it doesn't seem to play nicely with AWS OpsWorks – as this requires all cookbooks to be at the top level of the Chef repository.
My question then, is: what's the nicest way to use Chef with OpsWorks without including all of the dependencies at the top level of my repository?
As of recently, OpsWorks supports Chef 11.10 and Berkshelf, giving you a much nicer way of managing cookbook dependencies.