Skip to content
This repository was archived by the owner on Mar 28, 2019. It is now read-only.

Commit 5f3746d

Browse files
committed
Merge pull request #98 from puppetlabs-operations/noop
Support noop on the cron run
2 parents 2fba711 + 25a0bd3 commit 5f3746d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

manifests/agent/cron.pp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
class puppet::agent::cron(
2-
$enable = true,
1+
class puppet::agent::cron (
2+
$enable = true,
3+
$run_noop = false,
34
) {
45
include puppet::params
56

@@ -9,9 +10,15 @@
910
$ensure = absent
1011
}
1112

13+
if $run_noop {
14+
$cmd = "${puppet::params::puppet_cmd} agent --confdir ${puppet::params::puppet_confdir} --onetime --no-daemonize --noop >/dev/null"
15+
} else {
16+
$cmd = "${puppet::params::puppet_cmd} agent --confdir ${puppet::params::puppet_confdir} --onetime --no-daemonize >/dev/null"
17+
}
18+
1219
cron { 'puppet agent':
1320
ensure => $ensure,
14-
command => "${puppet::params::puppet_cmd} agent --confdir ${puppet::params::puppet_confdir} --onetime --no-daemonize >/dev/null",
21+
command => $cmd,
1522
minute => fqdn_rand(60),
1623
}
1724
}

0 commit comments

Comments
 (0)