Skip to content

Instantly share code, notes, and snippets.

@spulec
Last active December 11, 2015 03:59
Show Gist options
  • Save spulec/4541878 to your computer and use it in GitHub Desktop.
Save spulec/4541878 to your computer and use it in GitHub Desktop.
chef machine base setup
if [ ! -f /usr/local/bin/chef-client ]; then
# Become up to date
apt-get update
# Get our basics
apt-get install -y -q ruby1.9.1 ruby1.9.1-dev build-essential wget
fi
gem install ohai --no-rdoc --no-ri
gem install right_aws --no-ri --no-rdoc
gem install chef --no-rdoc --no-ri --version '10.16.4'
mkdir -p /etc/chef/ohai/hints && touch /etc/chef/ohai/hints/ec2.json
if [ ! -f /usr/bin/chef-client ]; then
ln -s /usr/local/bin/chef-client /usr/bin
fi
ENV=`cat /etc/chef/env.txt`
mkdir -p /var/log/chef
touch /var/log/chef/client.log
chef-client -j /etc/chef/first-boot.json -l debug -L /var/log/chef/client.log -E $ENV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment