Skip to content

Instantly share code, notes, and snippets.

@pborenstein
Forked from benjaminws/joyent-smartos.erb
Last active December 11, 2015 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pborenstein/4661341 to your computer and use it in GitHub Desktop.
Save pborenstein/4661341 to your computer and use it in GitHub Desktop.
# shove this in ~/.chef/bootstrap/joyent-smartos.erb
# run knife bootstrap <hostname> -d joyent-smartos
# Modified for base[64] 1.8.4
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
cd /tmp
pkgin -y install ruby193-chef
fi
mkdir -p /etc/chef
(
cat <<'EOP'
<%= validation_key %>
EOP
) > /tmp/validation.pem
# Make sure we run GNU awk
gawk 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