Created
August 21, 2013 14:22
-
-
Save jtimberman/6295120 to your computer and use it in GitHub Desktop.
Switching between organizations with Enterprise Chef with an environment variable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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