-
-
Save mhfs/1147879 to your computer and use it in GitHub Desktop.
Ubuntu 10.04 + Ruby 1.9.2p180 chef bootstrap file
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 ' | |
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 install ohai chef --no-rdoc --no-ri --verbose <%= '--prerelease' if @config[:prerelease] %> | |
mkdir -p /etc/chef | |
( | |
cat <<'EOP' | |
<%= IO.read(Chef::Config[:validation_key]) %> | |
EOP | |
) > /tmp/validation.pem | |
awk NF /tmp/validation.pem > /etc/chef/validation.pem | |
rm /tmp/validation.pem | |
( | |
cat <<'EOP' | |
log_level :info | |
log_location STDOUT | |
chef_server_url "<%= Chef::Config[:chef_server_url] %>" | |
validation_client_name "<%= Chef::Config[:validation_client_name] %>" | |
<% if @config[:chef_node_name] == nil %> | |
# Using default node name" | |
<% else %> | |
node_name "<%= @config[:chef_node_name] %>" | |
<% end %> | |
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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment