Skip to content

Instantly share code, notes, and snippets.

@michaelcarruthers
Created August 19, 2012 15:03
Show Gist options
  • Save michaelcarruthers/3395347 to your computer and use it in GitHub Desktop.
Save michaelcarruthers/3395347 to your computer and use it in GitHub Desktop.
SmartOS Chef Bootstrap
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
cd /tmp
pkgin -y install gcc-compiler gcc-runtime gcc-tools-0 ruby18-base ruby18-readline scmgit-base scmgit-docs gmake
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz
tar -xzf rubygems-1.8.10.tgz
cd rubygems-1.8.10
ruby setup.rb --no-format-executable
gem install --no-ri --no-rdoc json_pure
gem install --no-ri --no-rdoc -v=0.10.10 chef -- --with-cflags=-m64 --with-ldflags=-m64
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
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment