You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: manifests/agent.pp
+6-9Lines changed: 6 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,8 @@
27
27
# ['templatedir'] - Template dir, if unset it will remove the setting.
28
28
# ['configtimeout'] - How long the client should wait for the configuration to be retrieved before considering it a failure
29
29
# ['stringify_facts'] - Wether puppet transforms structured facts in strings or no. Defaults to true in puppet < 4, deprecated in puppet >=4 (and will default to false)
30
+
# ['cron_hour'] - What hour to run if puppet_run_style is cron
31
+
# ['cron_minute'] - What minute to run if puppet_run_style is cron
30
32
#
31
33
# Actions:
32
34
# - Install and configures the puppet agent
@@ -78,6 +80,8 @@
78
80
$certname = undef,
79
81
$http_proxy_host = undef,
80
82
$http_proxy_port = undef,
83
+
$cron_hour = '*',
84
+
$cron_minute = '*/30',
81
85
) inheritspuppet::params {
82
86
83
87
if ! defined(User[$::puppet::params::puppet_user]) {
@@ -135,18 +139,11 @@
135
139
$service_ensure = 'stopped'
136
140
$service_enable = false
137
141
138
-
# Run puppet as a cron - this saves memory and avoids the whole problem
139
-
# where puppet locks up for no reason. Also spreads out the run intervals
140
-
# more uniformly.
141
-
$time1 = fqdn_rand($puppet_run_interval)
142
-
$time2 = fqdn_rand($puppet_run_interval) + 30
143
-
144
142
cron { 'puppet-client':
145
143
command => $puppet_run_command,
146
144
user => 'root',
147
-
# run twice an hour, at a random minute in order not to collectively stress the puppetmaster
148
-
hour => '*',
149
-
minute => [ $time1, $time2 ],
145
+
hour => $cron_hour,
146
+
minute => $cron_minute,
150
147
}
151
148
}
152
149
# Run Puppet through external tooling, like MCollective
0 commit comments