splay is not numeric any more

This commit is contained in:
Udo Waechter
2015-01-13 17:26:17 +01:00
parent 340bdf611c
commit 9fdfc7cf76
3 changed files with 13 additions and 13 deletions

View File

@@ -6,8 +6,8 @@ class puppet::agent (
$run_hour = '*/1', $run_hour = '*/1',
$run_minute = '10', $run_minute = '10',
$run_if_ipmatch = undef, $run_if_ipmatch = undef,
$maxsleep = '3200',
$puppet_master = undef, $puppet_master = undef,
$splay = true,
$cron = true, $cron = true,
$environment = gsub($::domain, '.(lan|mysportgroup\.de)', '')) { $environment = gsub($::domain, '.(lan|mysportgroup\.de)', '')) {
case $::kernel { case $::kernel {
@@ -46,13 +46,13 @@ class puppet::agent (
} }
$cron_real = $daemonize ? { $cron_real = $daemonize ? {
false => $cron ? { false => $cron ? {
true => 'present', true => 'present',
default => 'absent', default => 'absent',
}, },
true => 'absent', true => 'absent',
default => $ensure, default => $ensure,
} }
cron { 'puppetrun': cron { 'puppetrun':
command => '/usr/local/sbin/puppetd_run.sh', command => '/usr/local/sbin/puppetd_run.sh',
user => 'root', user => 'root',
@@ -83,7 +83,7 @@ class puppet::agent (
ini_setting { 'puppet-agent-splay': ini_setting { 'puppet-agent-splay':
setting => 'splay', setting => 'splay',
value => $maxsleep; value => $splay;
} }
ini_setting { 'puppet-agent-env': ini_setting { 'puppet-agent-env':

View File

@@ -1,17 +1,17 @@
class puppet ( class puppet (
$ensure = 'present', $ensure = 'present',
$version = undef, $version = undef,
$agent = true, $agent = true,
$server = false, $server = false,
$facter_version = $ensure, $facter_version = $ensure,
$agent_cron = true, $agent_cron = true,
$puppetlabs_apt = true, $puppetlabs_apt = true,
$agent_norunifloggedin = false, $agent_norunifloggedin = false,
$agent_daemonize = true, $agent_daemonize = true,
$agent_run_hour = '*/1', $agent_run_hour = '*/1',
$agent_run_minute = '10', $agent_run_minute = '10',
$agent_run_if_ipmatch = '', $agent_run_if_ipmatch = '',
$agent_maxsleep = '3200', $agent_splay = true,
$server_dns_alt_names = undef, $server_dns_alt_names = undef,
$server_storeconfigs = false, $server_storeconfigs = false,
$server_storeconfigs_backend = undef, $server_storeconfigs_backend = undef,
@@ -50,7 +50,7 @@ class puppet (
daemonize => $agent_daemonize, daemonize => $agent_daemonize,
run_hour => $agent_run_hour, run_hour => $agent_run_hour,
run_if_ipmatch => $agent_run_if_ipmatch, run_if_ipmatch => $agent_run_if_ipmatch,
maxsleep => $agent_max_sleep, splay => $agent_splay,
cron => $agent_cron, cron => $agent_cron,
} }
} }

View File

@@ -53,7 +53,7 @@ if [ ${ISUNIIP} -gt 0 ]; then
fi fi
fi fi
MAXSLEEP=<%= @maxsleep %> #How many seconds to wait maximally #MAXSLEEP=<%= @maxsleep %> #How many seconds to wait maximally
SLEEP=${RANDOM} SLEEP=${RANDOM}
I=${RANDOM} I=${RANDOM}
@@ -63,7 +63,7 @@ if [ ${ISUNIIP} -gt 0 ]; then
SLEEP=${RANDOM} SLEEP=${RANDOM}
done done
# wait maximally $MAXSLEEP seconds # wait maximally $MAXSLEEP seconds
sleep $(expr ${SLEEP} % ${MAXSLEEP}) #sleep $(expr ${SLEEP} % ${MAXSLEEP})
# run puppetd # run puppetd
nice -n 12 $PUPPET agent -t 2&>>/var/log/puppet/puppetd_run.log nice -n 12 $PUPPET agent -t 2&>>/var/log/puppet/puppetd_run.log
fi fi