bash -c ' 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://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz tar zxf rubygems-1.3.7.tgz cd rubygems-1.3.7 ruby setup.rb --no-format-executable 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 (fqdn) <% else %> node_name "<%= @config[:chef_node_name] %>" <% end %> <% if Chef::Config[:environment] != nil %> environment "<%= Chef::Config[:environment]%>" <% end %> 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'