summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfiles/cluster/init.d/puppetmaster.CentOS5
-rw-r--r--manifests/init.pp9
2 files changed, 12 insertions, 2 deletions
diff --git a/files/cluster/init.d/puppetmaster.CentOS b/files/cluster/init.d/puppetmaster.CentOS
index 0cb5ef9..aa8efea 100755
--- a/files/cluster/init.d/puppetmaster.CentOS
+++ b/files/cluster/init.d/puppetmaster.CentOS
@@ -21,6 +21,7 @@ if [ -f /etc/sysconfig/puppetmaster ]; then
fi
PUPPETMASTER_OPTS=""
+[ -n "$PUPPETMASTER_PID_DIR" ] || PUPPETMASTER_PID_DIR="/var/run/puppet/"
[ -n "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_OPTS="--manifest=${PUPPETMASTER_MANIFEST}"
[ -n "$PUPPETMASTER_PORTS" ] && PUPPETMASTER_OPTS="$PUPPETMASTER_OPTS --servertype=mongrel"
[ -n "$PUPPETMASTER_LOG" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --logdest=${PUPPETMASTER_LOG}"
@@ -41,7 +42,7 @@ start() {
echo -n " (port "
for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
echo -n "${PUPPETMASTER_PORTS[$i]}"
- daemon $PUPPETMASTER $PUPPETMASTER_OPTS --masterport=${PUPPETMASTER_PORTS[$i]} --pidfile=puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid
+ daemon $PUPPETMASTER $PUPPETMASTER_OPTS --masterport=${PUPPETMASTER_PORTS[$i]} --pidfile=$PUPPETMASTER_PID_DIR/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid
RETVAL=$? || $RETVAL
done
echo -n ")"
@@ -65,7 +66,7 @@ stop() {
echo -n " (port "
for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
echo -n "${PUPPETMASTER_PORTS[$i]}"
- killproc -p puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid $PUPPETMASTER
+ killproc -p $PUPPETMASTER_PID_DIR/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid $PUPPETMASTER
RETVAL=$? || $RETVAL
done
echo -n ")"
diff --git a/manifests/init.pp b/manifests/init.pp
index b118e99..c58adbb 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -77,6 +77,11 @@ class puppetmaster inherits puppet {
require => Package[puppet],
}
+
+ Service[puppet]{
+ require +> Service[puppetmaster],
+ }
+
$real_puppetmaster_conf_source = $puppet_conf_source ? {
'' => [ "puppet://$server/files/puppet/master/puppet.conf",
"puppet://$server/puppet/master/puppet.conf" ],
@@ -106,6 +111,10 @@ class puppetmaster inherits puppet {
class puppetmaster::cluster inherits puppetmaster {
include mongrel, nginx
+ Service[puppetmaster]{
+ require +> Service[ngnix],
+ }
+
File[puppet_config] {
require => [ Package[mongrel], Package[nginx], File[nginx_config] ],
}