Skip to content

Instantly share code, notes, and snippets.

Created August 5, 2011 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anonymous/1128513 to your computer and use it in GitHub Desktop.
Save anonymous/1128513 to your computer and use it in GitHub Desktop.
centos 5.5 bootstrap
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
if [ ! -f /usr/bin/chef-client ]; then
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>-O /etc/yum.repos.d/aegisco-testing.repo http://testing.aegisco.com/el5/aegisco-testing.repo
yum install -y rubygems rubygem-chef
ln -s /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/chef-client /usr/bin
ln -s /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/chef-solo /usr/bin
ln -s /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/knife /usr/bin
ln -s /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/shef /usr/bin
fi
mkdir -p /etc/chef
(
cat <<'EOP'
<%= validation_key %>
EOP
) > /tmp/validation.pem
awk NF /tmp/validation.pem > /etc/chef/validation.pem
rm /tmp/validation.pem
(
cat <<'EOP'
<%= config_content %>
EOP
) > /etc/chef/client.rb
(
cat <<'EOP'
<%= { "run_list" => @run_list }.to_json %>
EOP
) > /etc/chef/first-boot.json
<%= start_chef %>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment