summaryrefslogtreecommitdiff
path: root/manifests/cron
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2012-04-12 15:35:03 -0400
committerMicah Anderson <micah@riseup.net>2012-04-12 15:35:03 -0400
commitdffec4d8134be8a2eb2bb3a8063b2d60d67308f1 (patch)
tree4b78702a3c720b3f73a005c738dc90aac1e136d1 /manifests/cron
parent4ebf3b82818427303d4d9d83daca8addcbc6f53c (diff)
parent506767d73515f79e05057df928bf7baa94b0dfcc (diff)
Merge remote-tracking branch 'lelutin/freebsd' into shared
Diffstat (limited to 'manifests/cron')
-rw-r--r--manifests/cron/freebsd.pp23
1 files changed, 23 insertions, 0 deletions
diff --git a/manifests/cron/freebsd.pp b/manifests/cron/freebsd.pp
new file mode 100644
index 0000000..5ff3419
--- /dev/null
+++ b/manifests/cron/freebsd.pp
@@ -0,0 +1,23 @@
+class puppet::cron::freebsd inherits puppet::freebsd {
+
+ include puppet::cron::base
+ if $puppet_http_compression { $puppet_http_compression_str = '--http_compression' }
+
+ if !$puppet_crontime {
+ $puppet_crontime_interval_minute = fqdn_rand(29)
+ $puppet_crontime_interval_minute2 = inline_template('<%= 30+puppet_crontime_interval_minute.to_i %>')
+ $puppet_crontime = "${puppet_crontime_interval_minute},${puppet_crontime_interval_minute2} * * * *"
+ }
+
+ #TODO ensure that the service is disabled in /etc/rc.conf[.local]
+
+ cron { 'puppetd_run':
+ command => "/usr/local/bin/puppet agent --onetime --no-daemonize --config=${puppet::puppet_config} --color false $puppet_http_compression_str | grep -E '(^err:|^alert:|^emerg:|^crit:)'",
+ user => 'root',
+ minute => split(regsubst($puppet_crontime,'^([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+)$','\1'),','),
+ hour => split(regsubst($puppet_crontime,'^([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+)$','\2'),','),
+ weekday => split(regsubst($puppet_crontime,'^([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+)$','\3'),','),
+ month => split(regsubst($puppet_crontime,'^([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+)$','\4'),','),
+ monthday => split(regsubst($puppet_crontime,'^([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+) ([\d,\-,*,/,\,]+)$','\5'),',')
+ }
+}