public
Created

knife bootstrap file for chef on solaris 5.10 x86

  • Download Gist
solaris.erb
HTML+ERB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
bash -c '
 
export PATH=/opt/csw/bin:/usr/sfw/bin:/usr/local/bin:/usr/sbin:/usr/bin
 
if [ ! -f /.profile ] ; then
echo "creating initial .profile"
echo -e "PATH=/opt/csw/bin:/usr/sfw/bin:/usr/local/bin:/usr/sbin:/usr/bin\nexport PATH" >> /.profile
fi
 
if [ ! -f /var/ld/ld.config ]; then
crle -u -l /opt/csw/lib -l /usr/local/lib
fi
 
if [ ! -f /var/sadm/install/admin/auto-install ]; then
echo -e "mail=\ninstance=overwrite\npartial=nocheck\nrunlevel=nocheck\nidepend=nocheck\nrdepend=nocheck\nspace=nocheck\nsetuid=nocheck\nconflict=nocheck\naction=nocheck\nbasedir=default" >> /var/sadm/install/admin/auto-install
fi
 
if [ ! -f /opt/csw/bin/pkgutil ]; then
echo "installing pkgutil from opencsw"
pkgadd -n -a /var/sadm/install/admin/auto-install -d http://get.opencsw.org/now CSWpkgutil
fi
 
if ! grep opencsw/unstable /etc/opt/csw/pkgutil.conf >& /dev/null; then
echo "mirror=http://mirror.opencsw.org/opencsw/unstable" >> /etc/opt/csw/pkgutil.conf
fi
 
if [ ! -f /opt/csw/bin/gmake ]; then
echo "installing csw packages"
/opt/csw/bin/pkgutil -y -i libgcc_s1 coreutils libssl1_0_0 wget gsed binutils gmake
fi
 
if [ ! -d /usr/local ] ; then
mkdir /usr/local
fi
 
if [ ! -f /usr/local/bin/ruby ]; then
cd /usr/src/
echo "getting SMC packages"
wget http://www.sunfreeware.com/intel/10/ruby-1.9.2p0-sol10-x86-local.gz
gunzip *.gz
echo "installing SMC packages"
pkgadd -n -a /var/sadm/install/admin/auto-install -d ruby-1.9.2p0-sol10-x86-local SMCruby
fi
 
if [ ! -L /usr/local/bin/make ]; then
ln -s /opt/csw/bin/gmake /usr/local/bin/make
fi
 
if [ ! -L /usr/local/bin/ld ]; then
ln -s /opt/csw/bin/gld /usr/local/bin/ld
fi
 
if [ -f /usr/ccs/bin/ld ]; then
mv /usr/ccs/bin/ld /usr/ccs/bin/ld.sun
fi
 
if [ ! -L /usr/local/bin/ginstall ]; then
ln -s /opt/csw/bin/ginstall /usr/local/bin/ginstall
fi
 
if [ ! -L /usr/local/bin/mkdir ]; then
ln -s /usr/bin/mkdir /usr/local/bin/mkdir
fi
 
if [ ! -f /usr/local/bin/chef-client ]; then
echo "installing chef"
gem install ohai --no-rdoc --no-ri --verbose
gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
fi
 
 
if ! grep solaris2 /usr/local/lib/ruby/gems/1.9.1/gems/chef-<%= chef_version %>/lib/chef/provider/group/usermod.rb >& /dev/null; then
echo "patching chef"
gsed -i "s/\"aix\"/\"aix\", \"solaris2\"/" /usr/local/lib/ruby/gems/1.9.1/gems/chef-<%= chef_version %>/lib/chef/provider/group/usermod.rb
fi
 
mkdir -p /etc/chef
 
(
cat <<'EOP'
<%= validation_key %>
EOP
) > /tmp/validation.pem
cat /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
 
if [ `zonename` == "global" ]; then
ntpdate pool.ntp.org
fi
 
<%= start_chef %>'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.