Skip to content

Instantly share code, notes, and snippets.

@stephenlauck
Forked from benjaminws/joyent-smartos.erb
Created June 26, 2012 22:57
Show Gist options
  • Save stephenlauck/2999929 to your computer and use it in GitHub Desktop.
Save stephenlauck/2999929 to your computer and use it in GitHub Desktop.
joyent-smartos.erb
# shove this in ~/.chef/bootstrap/joyent-smartos.erb
# run knife bootstrap <hostname> -d joyent-smartos
# works with joyent images:
# 01b2c898-945f-11e1-a523-af1afbe22822 smartos 1.6.3 smartos smartmachine
# f9e4be48-9466-11e1-bc41-9f993f5dff36 smartos64 1.6.3 smartos smartmachine
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
pkgin -f update
pkgin -y install gcc-compiler gcc-runtime gcc-tools scmgit-base scmgit-docs gmake ruby193-base ruby193-yajl-ruby
gem update --system
gem install --no-ri --no-rdoc ohai
gem install --no-ri --no-rdoc chef
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