The vagrant-berkshelf
plugin and Berkshelf in general is very cookbook-centric. Chef, however, is cookbook-repo centric. Installing the vagrant-berkshelf
plugin encourages you to use the cookbook-centric approach, treating each cookbook like its own software project.
You need to add each of the cookbooks in your cookbooks
directory to your Berksfile. There are a couple of approaches here:
If you only need one or two cookbooks, just add them using the Berkshelf path location:
cookbook 'bacon', path: '~/cookbooks/bacon'
If you want all your cookbooks, you can leverage Ruby here. A little-known secret is that the
Berksfile
is executed as Ruby, so you can loop and be magical:Dir['/Users/sethvargo/cookbooks/**'].each do |path| cookbook File.basename(path), path: path end
That will load each cookbook in that directory into your Berksfile (and thus Berkshelf)
Sources:
- I'm a core committer to the Berkshelf project
- I worked for Chef at the time of this post :)