Skip to content

Instantly share code, notes, and snippets.

@amccloud
Created October 28, 2012 23:25
Show Gist options
  • Save amccloud/3970419 to your computer and use it in GitHub Desktop.
Save amccloud/3970419 to your computer and use it in GitHub Desktop.
current_dir = File.dirname(__FILE__)
chef_repo_dir = "#{current_dir}/../../chef-repo"
home_dir = ENV['HOME']
user = ENV['KNIFE_USER'] || ENV['USER']
orgname = ENV['KNIFE_ORGNAME']
server_name = ENV['KNIFE_SERVER_NAME']
server_url = ENV['KNIFE_SERVER_URL']
cookbook_path ["#{chef_repo_dir}/cookbooks"]
log_level :info
log_location STDOUT
node_name user
client_key "#{current_dir}/#{user}.pem"
if orgname
chef_server_url "https://api.opscode.com/organizations/#{orgname}"
validation_client_name "#{orgname}-validator"
validation_key "#{current_dir}/#{orgname}-validator.pem"
elsif server_name
chef_server_url server_url
validation_client_name "client-validator"
validation_key "#{current_dir}/client-validator.pem"
end
cache_type "BasicFile"
cache_options(:path => "#{home_dir}/.chef/checksums")
knife[:rackspace_api_username] = ENV['RACKSPACE_USERNAME']
knife[:rackspace_api_key] = ENV['RACKSPACE_API_KEY']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment