Skip to content

Instantly share code, notes, and snippets.

@jtimberman
Created August 21, 2013 14:22
Show Gist options
  • Save jtimberman/6295120 to your computer and use it in GitHub Desktop.
Save jtimberman/6295120 to your computer and use it in GitHub Desktop.
Switching between organizations with Enterprise Chef with an environment variable.
% echo $ORGNAME
% knife config chef_server_url
chef_server_url: https://api.opscode.com/organizations/joshtest
% export ORGNAME=opstrain1
% knife config chef_server_url
chef_server_url: https://api.opscode.com/organizations/opstrain1
config_dir = File.dirname(__FILE__)
organization = ENV['ORGNAME'] || "joshtest"
chef_server_url "https://api.opscode.com/organizations/#{organization}"
validation_client_name "#{organization}-validator"
validation_key "#{config_dir}/#{organization}-validator.pem"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment