Skip to content

Instantly share code, notes, and snippets.

@tevert
Last active July 26, 2016 20:38
Show Gist options
  • Save tevert/c6cf4101cd43104efa6c3fb32549e48e to your computer and use it in GitHub Desktop.
Save tevert/c6cf4101cd43104efa6c3fb32549e48e to your computer and use it in GitHub Desktop.
A generic knife config file so I don't have to remember this every time, can be overriden/reused for multiple environments. Hopefully cross platform, but I haven't tested that.
org=ENV["CHEF_ORG"] || "Your Org Here"
user=ENV["CHEF_USER"] || "Your Chef Username"
# Try to use environment variables, otherwise assume this file is in ~/.chef
homedir=ENV["HOME"] || ENV["USERPROFILE"] || "#{File.dirname(__FILE__)}/.."
chef_server_url "https://manage.chef.io/organizations/#{org}"
client_key "#{homedir}/.chef/#{user}.pem"
node_name user
cookbook_path [ ".", "#{homedir}/.berkshelf/cookbooks" ]
cookbook_copyright org
cookbook_email "#{user}@#{org}.com"
cookbook_license "mit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment