Chef supermarket and chef-solo


What is the best way to make use of supermarket cookbooks in a chef-solo environment? I’m new to chef and it appears the cookbooks in the supermarket have to be built and expected to use knife to upload to a chef server?


I would depend on them in your metadata, and then berks install them.

Knife is a tool for working with chef-server, but I have never seen a cookbook written with the requirements tied to knife specifically.

There are some cookbooks that expect to be run on a chef server because they make use of the search to get information about other nodes on the server, but these are generally for clustered systems, and certainly do not constitute a majority of the cookbooks on the supermarket.

Dan-Joe Lopez


I’ve been publishing a very simple version of a wrapper for just such a
setup at . There are
various ways to get them into the local chef setup. I’ve just retested this
setup with the latest chefdk-2.4.17 version. The very simple tool, written
with “make”, sets up a local /etc/chef/ directory with the client.rb,
solo.rb, node.json, and assembles cookbooks locally using Berksfile and the
"berks install" and “berks vendor” commands.

I find this simple tool and setup works very well for chef-solo in
development environments: by using the local copies of the relevant
cookbooks, it avoids possible conflicts with cookbooks uploaded to a chef
server, and easily supports a directory of local cookbooks stored in git
and managed in /var/chef-solo/cookbooks-local/.