Skip to content

Instantly share code, notes, and snippets.

@schisamo
Forked from czottmann/ubuntu10.04-ruby192.erb
Created July 28, 2011 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save schisamo/1112693 to your computer and use it in GitHub Desktop.
Save schisamo/1112693 to your computer and use it in GitHub Desktop.
Ubuntu 10.04 + Ruby 1.9.2p180 chef bootstrap file
knife ec2 server create -G default -I ami-61be7908 -f m1.small \
-S schisamo -x ubuntu -d ubuntu10.04-ruby192
bash -c '
if [ ! -f /usr/local/bin/chef-client ]; then
apt-get update
apt-get -y upgrade
apt-get install -y build-essential wget zlib1g-dev libssl-dev libffi-dev
cd /usr/src
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.bz2
tar xjf ruby-1.9.2-p180.tar.bz2
cd ruby-1.9.2-p180
./configure
make
make install
cd ext/openssl/
ruby extconf.rb
make
make install
cd ../ext/readline/
ruby extconf.rb
make
make install
fi
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/local/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