Skip to content

Instantly share code, notes, and snippets.

@vpack
Last active February 7, 2018 11:15
Show Gist options
  • Save vpack/985bb3b79582c82e5642 to your computer and use it in GitHub Desktop.
Save vpack/985bb3b79582c82e5642 to your computer and use it in GitHub Desktop.
Chef Solo

Chef Solo is very useful for single server configuration management.

Chef Solo config file '/etc/chef/solo.rb' is optional and it defaults to repo='/var/chef/'.

Just copy cookbooks directly to /var/chef/cookbooks. Run them using chef-solo command.

For e.g

chef-solo -o 'recipe[awsutil::cloudwatchlog]'

or from a json file

chef-solo -j runlist.json

To install chef use the following command:

curl -L https://www.opscode.com/chef/install.sh | bash 

# to install an older version e.g 11

curl -L https://www.opscode.com/chef/install.sh | bash -s -- -v 11
{
"run_list": [ "recipe[awsutil::cloudwatchlog]" ]
}
# Sample
repo = '/etc/chef/src'
cookbook_path repo + '/cookbooks'
data_bag_path repo + '/data_bags'
role_path repo + '/roles'
log_level :info
log_location STDOUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment