/
hourly.pp
48 lines (47 loc) · 1.35 KB
/
hourly.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Type: cron::hourly
#
# This type creates an hourly cron job via a file in /etc/cron.d
#
# Parameters:
# ensure - The state to ensure this resource exists in. Can be absent, present
# Defaults to 'present'
# minute - The minute the cron job should fire on. Can be any valid cron minute value.
# Defaults to '0'.
# environment - An array of environment variable settings.
# Defaults to an empty set ([]).
# mode - The mode to set on the created job file
# Defaults to 0644.
# user - The user the cron job should be executed as.
# Defaults to 'root'.
# command - The command to execute.
# Defaults to undef.
#
# Actions:
#
# Requires:
#
# Sample Usage:
# cron::hourly {
# 'generate puppetdoc':
# minute => '1',
# environment => [ 'PATH="/usr/sbin:/usr/bin:/sbin:/bin"' ],
# command => 'puppet doc --modulepath /etc/puppet/modules >/var/www/puppet_docs.mkd';
# }
define cron::hourly(
$command = undef, $minute = 0, $environment = [],
$user = 'root', $mode = '0644', $ensure = 'present'
) {
cron::job {
$title:
ensure => $ensure,
minute => $minute,
hour => '*',
date => '*',
month => '*',
weekday => '*',
user => $user,
environment => $environment,
mode => $mode,
command => $command;
}
}