Created
June 6, 2011 21:44
-
-
Save dmeiners-zz/1011188 to your computer and use it in GitHub Desktop.
chef bootstrap centos
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/i386/epel-release-5-4.noarch.rpm%> | |
<%#rpm -Uvh http://download.elff.bravenet.com/5/i386/elff-release-5-3.noarch.rpm%> | |
<%#yum install -q -y ruby ruby-devel gcc gcc-c++ automake autoconf rubygems make%> | |
PATH=/opt/ruby-enterprise/bin:$PATH | |
<%#gem update --system%> | |
<%#gem update%> | |
gem install ohai chef --no-rdoc --no-ri --verbose <%= '--prerelease' if @config[:prerelease] %> | |
ln -sf /opt/ruby-enterprise/bin/chef-client /usr/bin/chef-client | |
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 | |
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