forked from MiamiOH/puppet-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
solaris.sh
42 lines (37 loc) · 926 Bytes
/
solaris.sh
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
#!/usr/bin/env bash
#
# This bootstraps Puppet on Solaris 10/11.
#
set -e
if [ "$(/usr/xpg4/bin/id -u)" != "0" ]; then
echo "This script must be run as root." >&2
exit 1
fi
# Install pkgutil if not present
if [ ! -f /opt/csw/bin/pkgutil ]; then
echo "Installing pkgutil..."
# Create the admin file
tee /tmp/pkgutil-admin <<-EOF >/dev/null
action=nocheck
conflict=nocheck
idepend=nocheck
instance=overwrite
mail=
partial=nocheck
runlevel=nocheck
setuid=nocheck
space=nocheck
EOF
# Install pkgutil
pkgadd -a /tmp/pkgutil-admin -d http://get.opencsw.org/now all
# Delete the admin file
rm /tmp/pkgutil-admin
fi
# Install Puppet
echo "Installing Puppet..."
/opt/csw/bin/pkgutil --yes --install puppet3
# Disable SMF service
echo "Disabling svc:/network/cswpuppetd..."
svcadm disable network/cswpuppetd
echo "Puppet installed!"
echo "NOTE: Remember to add /opt/csw/bin to your PATH, if you haven't done so."