summaryrefslogtreecommitdiff
path: root/pcr/puppet/puppet.install
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-11-23 02:33:48 -0800
committerroot <root@rshg054.dnsready.net>2012-11-23 02:33:48 -0800
commit1fce42e9327109bd47dba5e3e690144a23bbbc19 (patch)
treee48f488b533fcfa9f4e29f6d2b935e57adf0a178 /pcr/puppet/puppet.install
parent13c6302fab6118693af345756375923b9fb7da69 (diff)
Fri Nov 23 02:31:09 PST 2012
Diffstat (limited to 'pcr/puppet/puppet.install')
-rw-r--r--pcr/puppet/puppet.install46
1 files changed, 46 insertions, 0 deletions
diff --git a/pcr/puppet/puppet.install b/pcr/puppet/puppet.install
new file mode 100644
index 000000000..928df566b
--- /dev/null
+++ b/pcr/puppet/puppet.install
@@ -0,0 +1,46 @@
+# Puppet: Installer: Arch
+# Maintainer: Thomas S Hatch <thatch45 (at) Gmail (dot) com>
+# Contributor: Xavion <Xavion (dot) 0 (at) Gmail (dot) com>
+# Contributor: Miah Johnson <Miah (at) chia-pet dot org>
+
+pre_install() {
+ getent group puppet &>/dev/null || groupadd -r puppet -g 52 &>/dev/null
+ getent passwd puppet &>/dev/null || useradd -r -u 52 -g puppet -d /var/lib/puppet -s /sbin/nologin -c "Puppet" puppet &>/dev/null || :
+}
+
+pre_upgrade() {
+ pre_install
+ usermod -d /var/lib/puppet puppet &>/dev/null || :
+}
+
+post_install() {
+ :
+}
+
+pre_remove() {
+if [ -f /var/run/puppetmasterd.pid ]; then
+ PIDOF=$(pidof -xo %PPID puppetmasterd)
+ PIDFILE=$(cat /var/run/puppetmasterd.pid)
+ if [ $PIDOF -eq $PIDFILE ]; then
+ /etc/rc.d/puppetmaster stop
+ fi
+fi
+
+if [ -f /var/run/puppetd.pid ]; then
+ PIDOF=$(pidof -xo %PPID puppetd)
+ PIDFILE=$(cat /var/run/puppetd.pid)
+ if [ $PIDOF -eq $PIDFILE ]; then
+ /etc/rc.d/puppet stop
+ fi
+fi
+}
+
+post_remove() {
+ # Remove user and group
+ userdel puppet
+}
+
+op=$1
+shift
+
+$op "$@"