Skip to content

Instantly share code, notes, and snippets.

@rodriguezsergio
Created July 19, 2013 16:45
Show Gist options
  • Save rodriguezsergio/6040614 to your computer and use it in GitHub Desktop.
Save rodriguezsergio/6040614 to your computer and use it in GitHub Desktop.
An example knife.rb file for those getting started with Chef.
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name 'MY_USER_ON_CHEF_SERVER'
client_key "#{current_dir}/MY_USER_ON_CHEF_SERVER.pem"
validation_client_name 'CHEF-VALIDATOR'
validation_key "#{current_dir}/CHEF-VALIDATOR.pem"
chef_server_url 'https://URL'
syntax_check_cache_path "#{current_dir}/syntax_check_cache"
cache_type 'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path ["#{current_dir}/../cookbooks"]
cookbook_copyright "COMPANY"
cookbook_email "SYSADMIN@COMPANY.com"
readme_format "md"
encrypted_data_bag_secret "#{current_dir}/encrypted_data_bag_secret"
# AWS Credentials
#knife[:aws_ssh_key_id] = "KEY"
#knife[:region] = "REGION"
#knife[:aws_access_key_id] = "#{ENV['AWS_ACCESS_KEY_ID']}"
#knife[:aws_secret_access_key] = "#{ENV['AWS_SECRET_ACCESS_KEY']}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment