Skip to content

Instantly share code, notes, and snippets.

@sax
Last active December 16, 2015 15:39
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sax/5457464 to your computer and use it in GitHub Desktop.
Save sax/5457464 to your computer and use it in GitHub Desktop.
SmartOS Chef bootstrap template
# Wanelo Universal Bootstrap Script (W.U.B.S.)
bash -c '
# Linux Distros:
if [ $(uname -s | grep Linux) ]; then
true && curl -s -L https://www.opscode.com/chef/install.sh | bash
# Illumos Distros:
elif [ $(uname -s | grep SunOS) ]; then
if [ $(chef-client --version 2>/dev/null | grep -c Chef) -ne "1" ]; then
true && curl -s -L https://raw.github.com/bixu/chef-bootstrap/master/install.sh | bash -s
fi
fi
mkdir -p /etc/chef
(
cat <<'EOP'
<%= validation_key %>
EOP
) > /etc/chef/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
/opt/chef/embedded/bin/gem install --no-ri --no-rdoc ipaddr_extensions
<%= start_chef %>
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment