-
-
Save cavi21/2763176 to your computer and use it in GitHub Desktop.
Ubuntu 10.04 + Ruby 1.9.2p180 chef bootstrap file
This file contains hidden or 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
knife ec2 server create -G default -I ami-61be7908 -f m1.small \ | |
-S schisamo -x ubuntu -d ubuntu10.04-ruby192 |
This file contains hidden or 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 ' | |
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