Skip to content

Instantly share code, notes, and snippets.

@bbhoss
Forked from nkg/ubuntu-12.04-lts.erb.sh
Created July 16, 2012 22:39
Show Gist options
  • Save bbhoss/3125545 to your computer and use it in GitHub Desktop.
Save bbhoss/3125545 to your computer and use it in GitHub Desktop.
chef ubuntu 12.04 LTS bootstrap
bash -c '
if [ ! -f /usr/bin/chef-client ]; then
apt-get update
apt-get -y upgrade
apt-get install -y build-essential wget zlib1g-dev libssl-dev libffi-dev libncurses-dev libreadline-dev libyaml-dev libffi6 libssl0.9.8
wget https://s3.amazonaws.com/dev.ops/ruby-1.9.3-p194-perf_without_psych_no_warnings_amd64.deb
dpkg -i ruby-1.9.3-p194-perf_without_psych_no_warnings_amd64.deb
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.23.tgz
tar zxf rubygems-1.8.23.tgz
cd rubygems-1.8.23
ruby setup.rb --no-format-executable
fi
LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 export LC_CTYPE LANG
gem update --system --no-rdoc --no-ri
gem install ohai --no-rdoc --no-ri --verbose
gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
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
/usr/bin/chef-client -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