Question

I was wondering how Chef users organize custom cookbooks with relation to the main Chef repository. I started a repository based on a blank Chef Repo, and then installed custom cookbooks into the chef repo (i.e. the cookbook code is managed in the chef repo codebase). It's becoming a bit unmanageable though - especially when we want to work on different versions of a cookbook, and I'm wondering if it makes more sense to create independent cookbook projects and then pull in the cookbooks with Berkshelf - what's recommended in terms of best practises and how are you doing it?

Was it helpful?

Solution

Keeping cookbooks in a GIT chef repository doesn't scale well. I keep my cookbooks in an instance of Chef server, acting as a cookbook repository (I don't connect VMs to this chef server). It is designed to fulfil the same purpose as Nexus (or artifactory) in Java development, a place to hold my development dependencies.

When loading a new chef server I download my cookbook's dependencies using Berkshelf, referencing this chef server using an "chef_api" directive:

This will all change with Berkshelf 3.0 (Just released). I want to check out berkshelf-api which I'm hoping will simplify my work-flow. Reportedly Berkshelf-api can serve up cookbooks from:

  • Community cookbook site
  • An instance of chef server (like I do)
  • Cookbooks stored on file-system (This might suit you better)

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top