-
-
Save lusis/c52bab560b3dcb3402b7 to your computer and use it in GitHub Desktop.
A chef bootstrap template for Natty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash -c ' | |
echo "US/Eastern" | tee /etc/timezone | |
dpkg-reconfigure --frontend noninteractive tzdata | |
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