From 9fdfc7cf762a0c8a5332ce302bba28b1b4e17e7b Mon Sep 17 00:00:00 2001 From: Udo Waechter Date: Tue, 13 Jan 2015 17:26:17 +0100 Subject: [PATCH] splay is not numeric any more --- manifests/agent.pp | 8 ++++---- manifests/init.pp | 14 +++++++------- templates/puppetd_run.sh.erb | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/manifests/agent.pp b/manifests/agent.pp index fc873c3..21d791a 100644 --- a/manifests/agent.pp +++ b/manifests/agent.pp @@ -6,8 +6,8 @@ class puppet::agent ( $run_hour = '*/1', $run_minute = '10', $run_if_ipmatch = undef, - $maxsleep = '3200', $puppet_master = undef, + $splay = true, $cron = true, $environment = gsub($::domain, '.(lan|mysportgroup\.de)', '')) { case $::kernel { @@ -46,13 +46,13 @@ class puppet::agent ( } $cron_real = $daemonize ? { false => $cron ? { - true => 'present', + true => 'present', default => 'absent', }, true => 'absent', default => $ensure, } - + cron { 'puppetrun': command => '/usr/local/sbin/puppetd_run.sh', user => 'root', @@ -83,7 +83,7 @@ class puppet::agent ( ini_setting { 'puppet-agent-splay': setting => 'splay', - value => $maxsleep; + value => $splay; } ini_setting { 'puppet-agent-env': diff --git a/manifests/init.pp b/manifests/init.pp index 9e1f2a5..453701f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,17 +1,17 @@ class puppet ( - $ensure = 'present', - $version = undef, - $agent = true, - $server = false, + $ensure = 'present', + $version = undef, + $agent = true, + $server = false, $facter_version = $ensure, - $agent_cron = true, + $agent_cron = true, $puppetlabs_apt = true, $agent_norunifloggedin = false, $agent_daemonize = true, $agent_run_hour = '*/1', $agent_run_minute = '10', $agent_run_if_ipmatch = '', - $agent_maxsleep = '3200', + $agent_splay = true, $server_dns_alt_names = undef, $server_storeconfigs = false, $server_storeconfigs_backend = undef, @@ -50,7 +50,7 @@ class puppet ( daemonize => $agent_daemonize, run_hour => $agent_run_hour, run_if_ipmatch => $agent_run_if_ipmatch, - maxsleep => $agent_max_sleep, + splay => $agent_splay, cron => $agent_cron, } } diff --git a/templates/puppetd_run.sh.erb b/templates/puppetd_run.sh.erb index e51b8df..15b1057 100755 --- a/templates/puppetd_run.sh.erb +++ b/templates/puppetd_run.sh.erb @@ -53,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} @@ -63,7 +63,7 @@ if [ ${ISUNIIP} -gt 0 ]; then SLEEP=${RANDOM} done # wait maximally $MAXSLEEP seconds - sleep $(expr ${SLEEP} % ${MAXSLEEP}) + #sleep $(expr ${SLEEP} % ${MAXSLEEP}) # run puppetd nice -n 12 $PUPPET agent -t 2&>>/var/log/puppet/puppetd_run.log fi