Skip to content

Instantly share code, notes, and snippets.

@rtacconi
Last active February 1, 2016 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtacconi/9bcd70338c0fd45e3c2b to your computer and use it in GitHub Desktop.
Save rtacconi/9bcd70338c0fd45e3c2b to your computer and use it in GitHub Desktop.
wget https://opscode-omnibus-packages.s3.amazonaws.com/el/7/x86_64/chefdk-0.10.0-1.el7.x86_64.rpm
rpm -i chefdk-0.10.0-1.el7.x86_64.rpm
if [ ! -d /var/chef/cache/ ]; then mkdir -p /var/chef/cache/; fi
if [ ! -d /var/chef/cookbooks/ ]; then mkdir -p /var/chef/cookbooks/; fi
if [ ! -d /var/chef/checksums/ ]; then mkdir -p /var/chef/checksums/; fi
if [ ! -d /etc/chef ]; then mkdir -p /etc/chef; fi
if [ ! -d /var/chef/backup ]; then mkdir -p /var/chef/backup; fi
if [ ! -d /var/chef/environments ]; then mkdir -p /var/chef/environments; fi
if [ ! -f /var/chef/environments/production.rb ]; then mkdir -p /var/chef/environments/production.rb; fi
cat << EOF > /etc/chef/solo.rb
require 'socket'
checksum_path '/var/chef/checksums'
cookbook_path '/var/chef/cookbooks'
environment 'production'
environment_path '/var/chef/environments'
file_backup_path '/var/chef/backup'
file_cache_path '/var/chef/cache'
log_level :info
log_location STDOUT
node_name Socket.gethostname
EOF
cat << EOF > /etc/chef/solo.json
{
"run_list": [
"recipe[your-cookbook::default]"
]
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment