Created
April 22, 2010 05:10
-
-
Save adamhjk/374844 to your computer and use it in GitHub Desktop.
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
command = <<EOH | |
bash -c ' | |
echo nameserver 208.67.222.222 > /etc/resolv.conf | |
echo nameserver 208.67.220.220 >> /etc/resolv.conf | |
if [ ! -f /usr/bin/chef-client ]; then | |
apt-get update | |
apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras | |
cd /tmp | |
wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz | |
tar xvf rubygems-1.3.6.tgz | |
cd rubygems-1.3.6 | |
ruby setup.rb | |
cp /usr/bin/gem1.8 /usr/bin/gem | |
gem install chef ohai --no-rdoc --no-ri --verbose | |
fi | |
( | |
cat <<'EOP' | |
#{IO.read(Chef::Config[:validation_key])} | |
EOP | |
) > /etc/chef/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]}" | |
EOP | |
) > /etc/chef/client.rb | |
( | |
cat <<'EOP' | |
#{{ "run_list" => @name_args[1..-1] }.to_json} | |
EOP | |
) > /etc/chef/first-boot.json | |
/usr/bin/chef-client -j /etc/chef/first-boot.json' | |
EOH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment