We are resource limited here, and want our qa and staging environments on one machine.

We are going to run separate binaries and confs for our app & supporting services.

According to chef docs it is possible to have a single machine be two nodes. It just never explains how.

Much appreciated!


You'll need to execute chef client with an alternative configuration. The default config file and directory is /etc/chef/client.rb. You could use that one for one of the nodes / environments. Let's assume that will be "staging". You should probably make sure the node and environment are set up for the proper values:

node_name "mynode.staging"
environment "staging"

The other you could create such as /etc/chef/qa/client.rb for your qa configuration. In order to avoid conflict, you'll need to change the various configuration values for Chef that point in /etc/chef, and /var/chef.

See the Chef Configuration Settings wiki page for a complete list of configuration settings you can modify.

You should use the node_name and environment values similar to the staging environment. When you run chef, specify the alternative configuration file.

chef-client -c /etc/chef/qa/client.rb

  • Thanks, I'd upvote but I don't have enough repuation on this site yet. Much appreciated!! – Jeff V Oct 10 '12 at 16:44
  • You're welcome. I'm glad it was helpful. – jtimberman Oct 11 '12 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.