Skip to content

Instantly share code, notes, and snippets.

@andrewgross
Created May 2, 2012 19:22
Show Gist options
  • Save andrewgross/2579487 to your computer and use it in GitHub Desktop.
Save andrewgross/2579487 to your computer and use it in GitHub Desktop.
if [ ! -f /usr/local/bin/chef-client ]; then
apt-get update
apt-get install -y ruby1.9.1 ruby1.9.1-dev build-essential wget
fi
gem install ohai --no-rdoc --no-ri --verbose
gem install right_aws --no-ri --no-rdoc --verbose
gem install chef --no-rdoc --no-ri --verbose
mkdir -p /etc/chef
(
cat <<'EOP'
<%= validation_key %>
EOP
) > /tmp/validation.pem
awk NF /tmp/validation.pem > /etc/chef/validation.pem
rm /tmp/validation.pem
(
cat <<'EOP'
<%= config_content %>
EOP
) > /etc/chef/client.rb
(
cat <<'EOP'
<%= @run_list.to_json %>
EOP
) > /etc/chef/first-boot.json
/usr/local/bin/chef-client -l debug -j /etc/chef/first-boot.json -E #{bootstrap_environment}'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment