Multiple chef environments

Well, this is a little bit strange, but in opscode website, it’s not really clear how to configure your chef client to access multiple servers.

Not only that this is possible and more then just nice to have, in many cases, it’s essential:

  1. You might manage multiple servers
  2. You don’t want to create a knife file in a privileged directory
  3. You want to test a client configuration

To make it happen:

In any folder that you wish to create chef access, just create a .chef sub folder. ingredients for this folder are:

  1. knife.rb file.
  2. public and private key files (you get these from the chef server).

note that you need to set your permissions in the server, and most likely to have an admin access if you want the new user to be able to create/delete nodes.