Skip to content

Instantly share code, notes, and snippets.

@williamsjj
Created July 21, 2011 05:30
Show Gist options
  • Save williamsjj/1096563 to your computer and use it in GitHub Desktop.
Save williamsjj/1096563 to your computer and use it in GitHub Desktop.
bash -c '
if [ ! -f /usr/bin/chef-client ]; then
pkg refresh
echo "Installing gcc-3 and header-math packages."
pkg install -q gcc-3
pkg install -q header-math
if [ ! -f /usr/bin/ruby ]; then
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
tar xvfz ruby-1.9.2-p290.tar.gz
cd ruby-1.9.2-p290
./configure --prefix=/usr
make && make install
fi
fi
gem install ohai --no-rdoc --no-ri --verbose
gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
wget https://raw.github.com/williamsjj/ohai/8ff9fbeebee150ccf59fdaa03f207a12f3646628/lib/ohai/plugins/solaris2/platform.rb -O /usr/lib/ruby/gems/1.9.1/gems/ohai-`ohai -v | sed "s/[^0-9.]*//"`/lib/ohai/plugins/solaris2/platform.rb
wget https://raw.github.com/williamsjj/chef/dc6d3c4e0862699a118acd411011a4294e94f313/chef/lib/chef/platform.rb -O /usr/lib/ruby/gems/1.9.1/gems/chef-`chef-client -v | sed "s/[^0-9.]*//"`/lib/chef/platform.rb
mkdir -p /etc/chef
(
cat <<'EOP'
<%= validation_key %>
EOP
) > /tmp/validation.pem
cat /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
ntpdate time.xmission.com
<%= start_chef %>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment