hiera compatible refactoring

This commit is contained in:
Udo Waechter
2014-06-03 10:28:22 +02:00
parent d7d9a83dc8
commit 11001cb209
4 changed files with 31 additions and 38 deletions

View File

@@ -1,22 +1,21 @@
#!/usr/bin/env bash
# $Id: puppetd_run.sh.erb 4177 2011-04-05 08:02:08Z uwaechte $
# a wrapper script, to run puppetd after a random time
# this will be called by cron at the same time on each client,
# but should not call the master at the same time as the others.
<% if norunifloggedin == true -%>
<% if @norunifloggedin == true -%>
# not running if users are logged in
[[ $(who|wc -l) -gt 0 ]] && exit 0
<% end -%>
export FACTERLIB="<%= scope.lookupvar("factpath") %>"
#export FACTERLIB="<%= scope.lookupvar("factpath") %>"
PATH="/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
PUPPET=$(which puppet)
[[ -e ${PUPPET} ]] || exit 1
PUPPET="${PUPPET}"
<% if run_if_ipmatch != "" -%>
ISUNIIP=$(ifconfig |grep -c -e "<%= run_if_ipmatch %>")
<% if @run_if_ipmatch != "" -%>
ISUNIIP=$(ifconfig |grep -c -e "<%= @run_if_ipmatch %>")
<% else -%>
ISUNIIP=1
<% end -%>
@@ -54,7 +53,7 @@ if [ ${ISUNIIP} -gt 0 ]; then
fi
fi
MAXSLEEP=<%= maxsleep %> #How many seconds to wait maximally
MAXSLEEP=<%= @maxsleep %> #How many seconds to wait maximally
SLEEP=${RANDOM}
I=${RANDOM}