Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 39 lines (32 sloc) 1.31 kb
b062710 Chef Solo componants ready.
Ben Rockwood authored
1 #!/bin/bash
2 # Chef Solo Bootstrap for SmartOS GZ
3 # See: http://wiki.smartos.org/display/DOC/Using+Chef
4 # EXAMPLE USE: curl -s http://8.12.35.49/smartos/bootstrap-smartos.sh | bash
5
6 if [[ -f /opt/custom/smf/chef-solo.xml && -f /var/chef/solo.rb ]]; then
7 echo "WARNING: Chef Solo already installed and configured. Sleeping for 30s. Ctl-C to abort."
8 sleep 30
9 fi
10
11 # Download and install Chef Fat Client
12 cd /tmp && /usr/bin/curl -Os http://8.12.35.49/smartos/Chef-fatclient-SmartOS-10.14.2.tar.bz2
13 cd / && gtar xfj /tmp/Chef-fatclient-SmartOS-10.14.2.tar.bz2
14 cp /usr/bin/gtar /opt/chef/bin/tar
15 mkdir -p /opt/custom/smf /var/chef
16
17 # Create Chef Solo Configuration
18 cat >/var/chef/solo.rb <<END
19 ##
20 ## Joyent Chef Solo Configuration
21 ##
22 file_cache_path "/var/chef"
23 cookbook_path "/var/chef/cookbooks"
24 json_attribs "http://8.12.35.49/smartos/smartos.json"
25 recipe_url "http://8.12.35.49/smartos/smartos_cookbooks.tar.gz"
26 END
27
28 if [[ $NODENAME ]]; then
29 echo "node_name \"${NODENAME}\"" >>/var/chef/solo.rb
30 fi
31
32 # Install and Import SMF Service for Chef Solo
33 cd /opt/custom/smf && /usr/bin/curl -Os http://8.12.35.49/smartos/chef-solo.xml
34 svccfg import /opt/custom/smf/chef-solo.xml
35
36 if svcs chef-solo >/dev/null; then
37 echo "Installation complete. Chef Solo SMF Service State: `/usr/bin/svcs -Ho state chef-solo`"
38 fi
Something went wrong with that request. Please try again.