Skip to content

Commit bcf162c

Browse files
committed
Retain the default behaviour; spread the runs through the hour
1 parent 8250f40 commit bcf162c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

manifests/agent.pp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
$http_proxy_host = undef,
8282
$http_proxy_port = undef,
8383
$cron_hour = '*',
84-
$cron_minute = '*/30',
84+
$cron_minute = undef,
8585
) inherits puppet::params {
8686

8787
if ! defined(User[$::puppet::params::puppet_user]) {
@@ -139,11 +139,21 @@
139139
$service_ensure = 'stopped'
140140
$service_enable = false
141141

142+
# Default to every 30 minutes - random around the clock
143+
if $cron_minute == undef {
144+
$time1 = fqdn_rand(30)
145+
$time2 = $time1 + 30
146+
$minute = [ $time1, $time2 ]
147+
}
148+
else {
149+
$minute = $cron_minute
150+
}
151+
142152
cron { 'puppet-client':
143153
command => $puppet_run_command,
144154
user => 'root',
145155
hour => $cron_hour,
146-
minute => $cron_minute,
156+
minute => $minute,
147157
}
148158
}
149159
# Run Puppet through external tooling, like MCollective

0 commit comments

Comments
 (0)