Created
May 20, 2011 19:22
-
-
Save whiteley/983584 to your computer and use it in GitHub Desktop.
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 ' | |
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
rpm -Uvh http://rpm.aegisco.com/aegisco/rhel/aegisco-rhel.rpm | |
yum install -q -y rubygem-chef | |
ln -s /usr/lib/ruby/gems/1.8/bin/chef-client /usr/bin | |
( | |
cat <<'EOP' | |
case ":${PATH:-}:" in | |
*:/usr/lib/ruby/gems/1.8/bin:*) ;; | |
*) PATH="${PATH:+$PATH:}/usr/lib/ruby/gems/1.8/bin" ;; | |
esac | |
EOP | |
) > /etc/profile.d/rubygems.sh | |
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/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