summaryrefslogtreecommitdiff
path: root/social/puppet
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-08-03 20:38:15 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-08-03 20:38:15 -0300
commitce20e84942a62970bede1671e8ea94f180f50319 (patch)
treef4012e4e2e49d589f0b853b4ee0264f6496d1df6 /social/puppet
parentfdcdd76fbbd6f12a4e0efe62d98ba33669ceb493 (diff)
social/puppet-2.7.1-1
and dependencies
Diffstat (limited to 'social/puppet')
-rw-r--r--social/puppet/PKGBUILD52
-rwxr-xr-xsocial/puppet/puppet45
-rw-r--r--social/puppet/puppet.conf30
-rw-r--r--social/puppet/puppet.install46
-rwxr-xr-xsocial/puppet/puppetmaster45
5 files changed, 218 insertions, 0 deletions
diff --git a/social/puppet/PKGBUILD b/social/puppet/PKGBUILD
new file mode 100644
index 000000000..10338bea0
--- /dev/null
+++ b/social/puppet/PKGBUILD
@@ -0,0 +1,52 @@
+# 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>
+# Contributor: Dave Simons <miouhpi (at) Gmail (dot) com>
+
+pkgname=puppet
+pkgver=2.7.1
+pkgrel=1
+pkgdesc="A system for automating system administration tasks."
+arch=("any")
+url="http://puppetlabs.com/projects/puppet/"
+license=("Apache")
+depends=("ruby" "ruby-shadow" "facter")
+backup=("etc/puppet/puppet.conf")
+options=(emptydirs)
+install="puppet.install"
+source=("http://puppetlabs.com/downloads/puppet/puppet-$pkgver.tar.gz"
+ "puppet"
+ "puppetmaster"
+ "puppet.conf")
+md5sums=('7a0346758af0222dc5e2b2b1a99c44ec'
+ '59dbf39e251bc4877e7604a5876c642d'
+ '4c507c580cb28d7a5adc9ea6b3626657'
+ 'a6c0ce2eb12d62fdd3421aa9dff3477d')
+
+package() {
+ cd $srcdir/puppet-$pkgver
+
+ # Install
+ ruby ./install.rb \
+ --destdir=$pkgdir \
+ --bindir=/usr/bin \
+ --sbindir=/usr/sbin \
+ --mandir=/usr/share/man
+
+ # Set up vim and emacs
+ install -Dp -m0644 ext/vim/ftdetect/puppet.vim $pkgdir/usr/share/vim/vimfiles/ftdetect/puppet.vim
+ install -Dp -m0644 ext/vim/syntax/puppet.vim $pkgdir/usr/share/vim/vimfiles/syntax/puppet.vim
+ install -Dp -m0644 ext/emacs/puppet-mode.el $pkgdir/usr/share/emacs/site-lisp/puppet-mode.el
+ install -Dp -m0644 ext/emacs/puppet-mode-init.el $pkgdir/usr/share/emacs/site-lisp/site-start.d/puppet-mode-init.el
+
+ # Configuration and rc scripts
+ install -d $pkgdir/etc/{puppet,rc.d}
+ install -m 644 $srcdir/puppet.conf $pkgdir/etc/puppet/puppet.conf
+
+ install -D $srcdir/puppet $pkgdir/etc/rc.d/puppet
+ install -D $srcdir/puppetmaster $pkgdir/etc/rc.d/puppetmaster
+
+ # Move pi to prevent file conflict
+ mv $pkgdir/usr/bin/pi $pkgdir/usr/bin/puppet-pi
+}
diff --git a/social/puppet/puppet b/social/puppet/puppet
new file mode 100755
index 000000000..4126be850
--- /dev/null
+++ b/social/puppet/puppet
@@ -0,0 +1,45 @@
+#!/bin/bash
+DAEMON=$(type -p puppetd)
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+[ -f /etc/conf.d/puppet ] && . /etc/conf.d/puppet
+
+PID=$(pidof -xo %PPID $DAEMON)
+case "$1" in
+ start)
+ stat_busy "Starting Puppet Daemon"
+ if [ -z "$PID" ]; then
+ [ -f /var/run/puppet.pid ] && rm -f /var/run/puppet.pid
+ $DAEMON $PUPPETD_ARGS
+ fi
+ if [ ! -z "$PID" -o $? -gt 0 ]; then
+ stat_fail
+ else
+ PID=$(pidof -xo %PPID $DAEMON)
+ echo $PID > /var/run/puppet.pid
+ add_daemon puppet
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Puppet Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon puppet
+ rm -f /var/run/puppet.pid
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ if [ ! -z $PID ]; then
+ while ps -p $PID > /dev/null; do sleep 1; done
+ fi
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
diff --git a/social/puppet/puppet.conf b/social/puppet/puppet.conf
new file mode 100644
index 000000000..169f28b3b
--- /dev/null
+++ b/social/puppet/puppet.conf
@@ -0,0 +1,30 @@
+[main]
+ # The Puppet log directory.
+ # The default value is '$vardir/log'.
+ logdir = /var/log/puppet
+
+ # Where Puppet PID files are kept.
+ # The default value is '$vardir/run'.
+ rundir = /var/run/puppet
+
+ # Where SSL certificates are kept.
+ # The default value is '$confdir/ssl'.
+ ssldir = $vardir/ssl
+ factpath=$vardir/lib/facter
+ pluginsync=true
+
+
+[agent]
+ # The file in which puppetd stores a list of the classes
+ # associated with the retrieved configuratiion. Can be loaded in
+ # the separate ``puppet`` executable using the ``--loadclasses``
+ # option.
+ # The default value is '$confdir/classes.txt'.
+ classfile = $vardir/classes.txt
+
+ # Where puppetd caches the local configuration. An
+ # extension indicating the cache format is added automatically.
+ # The default value is '$confdir/localconfig'.
+ localconfig = $vardir/localconfig
+
+#[master]
diff --git a/social/puppet/puppet.install b/social/puppet/puppet.install
new file mode 100644
index 000000000..928df566b
--- /dev/null
+++ b/social/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 "$@"
diff --git a/social/puppet/puppetmaster b/social/puppet/puppetmaster
new file mode 100755
index 000000000..8b3971053
--- /dev/null
+++ b/social/puppet/puppetmaster
@@ -0,0 +1,45 @@
+#!/bin/bash
+DAEMON=$(type -p puppetmasterd)
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+[ -f /etc/conf.d/puppetmaster ] && . /etc/conf.d/puppetmaster
+
+PID=$(pidof -xo %PPID $DAEMON)
+case "$1" in
+ start)
+ stat_busy "Starting Puppet Master Daemon"
+ if [ -z "$PID" ]; then
+ [ -f /var/run/puppetmaster.pid ] && rm -f /var/run/puppetmaster.pid
+ $DAEMON $PUPPETMASTER_ARGS
+ fi
+ if [ ! -z "$PID" -o $? -gt 0 ]; then
+ stat_fail
+ else
+ PID=$(pidof -xo %PPID $DAEMON)
+ echo $PID > /var/run/puppetmaster.pid
+ add_daemon puppetmaster
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Puppet Master Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon puppetmaster
+ rm -f /var/run/puppetmaster.pid
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ if [ ! -z $PID ]; then
+ while ps -p $PID > /dev/null; do sleep 1; done
+ fi
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac