I’m new with chef, and I apologize if this is an overly simplistic
question, but I can’t seem to find the best way to approach this
I’ve got several clients (e.g. Acme, and Big Inc) for whom I’ve build
web apps, and I’d like to use Chef to deploy these. I’m using Hosted
Chef, and I’ve described each app in a data bag, but I’m not sure of
the best route to configure a single client’s app on a single node.
Here’s some background:
Each client’s app is described in a data bag item:
Each item looks something like this:
I’ve got a recipe (mycookbook::default) that looks something like this:
search(:apps) do |app|
And I create a new node using the rackspace plugin, like so:
knife rackspace server create -N acme01 -S acme01 -r
"recipe[mycookbook::default]" -I 112 -f 1
This would install both apps (acme and big_inc) on the node. What’s
the preferred method for specifying which app should be configured on
a single node?
Should I delete the data bag items from the Chef Server (in the above
case, remove big_inc.json before creating the node)?
Or should I write client-specific recipes that search for some
distinguishing information in the data bag (e.g. I include the
client’s name as a key)? This seems like it would result in a lot of
Or is there a better way to do this?
Thanks in advance!