summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-07-29 22:28:34 +0000
committermh <mh@immerda.ch>2008-07-29 22:28:34 +0000
commit86ca4e220d466ddc203bdd7ce20cb158cf634d3f (patch)
treef8080a6d85f40c7ee4a4f7a50ee81850e1116f86 /files
parent7ca66ae888b93096862e8ebfd54e14eb5daddcd1 (diff)
Merge commit 'puzzle/development'
Diffstat (limited to 'files')
-rwxr-xr-xfiles/cluster/init.d/puppetmaster.CentOS32
-rw-r--r--files/sysconfig/puppetmaster30
2 files changed, 52 insertions, 10 deletions
diff --git a/files/cluster/init.d/puppetmaster.CentOS b/files/cluster/init.d/puppetmaster.CentOS
index aa8efea..5edf5a9 100755
--- a/files/cluster/init.d/puppetmaster.CentOS
+++ b/files/cluster/init.d/puppetmaster.CentOS
@@ -23,7 +23,11 @@ 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"
+if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
+ PUPPETMASTER_OPTS="$PUPPETMASTER_OPTS --servertype=mongrel"
+elif [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -eq 1 ]; then
+ PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"
+fi
[ -n "$PUPPETMASTER_LOG" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --logdest=${PUPPETMASTER_LOG}"
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} \
${PUPPETMASTER_EXTRA_OPTS}"
@@ -38,12 +42,12 @@ start() {
# Confirm the manifest exists
if [ -r $PUPPETMASTER_MANIFEST ]; then
- if [ -n "$PUPPETMASTER_PORTS" ]; then
+ if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
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_PID_DIR/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid
- RETVAL=$? || $RETVAL
+ daemon $PUPPETMASTER $PUPPETMASTER_OPTS --masterport=${PUPPETMASTER_PORTS[$i]} --pidfile=$PUPPETMASTER_PID_DIR/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid
+ RETVAL=$? || $RETVAL
done
echo -n ")"
else
@@ -62,17 +66,17 @@ start() {
stop() {
echo -n $"Stopping puppetmaster: "
- if [ -n "$PUPPETMASTER_PORTS" ]; then
+ if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
echo -n " (port "
for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
echo -n "${PUPPETMASTER_PORTS[$i]}"
- killproc -p $PUPPETMASTER_PID_DIR/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid $PUPPETMASTER
- RETVAL=$? || $RETVAL
+ killproc -p $PUPPETMASTER_PID_DIR/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid $PUPPETMASTER
+ RETVAL=$? || $RETVAL
done
echo -n ")"
else
- killproc $PUPPETMASTER
- RETVAL=$?
+ killproc $PUPPETMASTER
+ RETVAL=$?
fi
echo
[ $RETVAL -eq 0 ] && rm -f "$lockfile"
@@ -84,6 +88,11 @@ restart() {
start
}
+genconfig() {
+ echo -n $"Generate configuration puppetmaster: "
+ $PUPPETMASTER $PUPPETMASTER_OPTS --genconfig
+}
+
case "$1" in
start)
start
@@ -101,8 +110,11 @@ case "$1" in
status $PUPPETMASTER
RETVAL=$?
;;
+ genconfig)
+ genconfig
+ ;;
*)
- echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
+ echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|genconfig}"
exit 1
esac
diff --git a/files/sysconfig/puppetmaster b/files/sysconfig/puppetmaster
new file mode 100644
index 0000000..1966e30
--- /dev/null
+++ b/files/sysconfig/puppetmaster
@@ -0,0 +1,30 @@
+# Location of the main manifest
+#PUPPETMASTER_MANIFEST=/etc/puppet/manifests/site.pp
+
+# Where to log general messages to.
+# Specify syslog to send log messages to the system log.
+#PUPPETMASTER_LOG=syslog
+
+# You may specify an alternate port or an array of ports on which
+# puppetmaster should listen. Default is: 8140
+# If you specify more than one port, the puppetmaster ist automatically
+# started with the servertype set to mongrel. This might be interesting
+# if you'd like to run your puppetmaster in a loadbalanced cluster.
+# Please note: this won't setup nor start any loadbalancer.
+# If you'd like to run puppetmaster with mongrel as servertype but only
+# on one (specified) port, you have to add --servertype=mongrel to
+# PUPPETMASTER_EXTRA_OPTS.
+# Default: Empty (Puppetmaster isn't started with mongrel, nor on a
+# specific port)
+#PUPPETMASTER_PORTS=""
+# Puppetmaster on a different port, run with standard webrick servertype
+#PUPPETMASTER_PORTS="8141"
+# Example with multiple ports which will start puppetmaster with mongrel
+# as a servertype
+#PUPPETMASTER_PORTS=( 18140 18141 18142 18143 )
+
+# You may specify an alternate pid directory.
+#PUPPETMASTER_PID_DIR=/var/run/puppet
+
+# You may specify other parameters to the puppetmaster here
+#PUPPETMASTER_EXTRA_OPTS=--noca