Skip to content

Instantly share code, notes, and snippets.

@lusis
Created July 18, 2011 10:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lusis/2c049eb9df73ed0e01ea to your computer and use it in GitHub Desktop.
Save lusis/2c049eb9df73ed0e01ea to your computer and use it in GitHub Desktop.
custom natty bootstrap template for chef
bash -c '
if [ ! -f /usr/bin/chef-client ]; then
apt-get update
apt-get install -y ruby ruby-dev build-essential wget libruby-extras
cd /tmp
wget http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
tar zxf rubygems-1.7.2.tgz
cd rubygems-1.7.2
ruby setup.rb --no-format-executable
fi
gem install ohai --no-rdoc --no-ri --verbose
gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
gem install aws-s3 encrypted_strings --no-ri --no-rdoc --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" => @run_list }.to_json %>
EOP
) > /etc/chef/first-boot.json
echo -e <%= start_chef %>
/usr/bin/chef-client -j /etc/chef/first-boot.json -E <%= @chef_config[:environment] || "_default" %>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment