-
Notifications
You must be signed in to change notification settings - Fork 9
/
sieve.pp
52 lines (52 loc) · 1.28 KB
/
sieve.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
48
49
50
51
52
# @summary Simple sieve script resource that gets compiled by sievec and
# notifies the dovecot service.
#
# @param content
# The content of the file.
#
# @param group
# The group that should own the file.
#
# @param mode
# The permissions for the file.
#
# @param owner
# The user that should own the file.
#
# @param path
# The target path for the file.
#
# @param sievec
# The path to the sievec binary.
#
# @param source
# Optional source for the file resource to use instead of `$content`.
#
# @author Bernhard Frauendienst <puppet@nospam.obeliks.de>
#
define dovecot::sieve (
String $content = undef,
Variant[Integer, String] $group = 0,
Variant[Integer, String] $mode = '0644',
Variant[Integer, String] $owner = 'root',
Stdlib::Absolutepath $path = $name,
Stdlib::Absolutepath $sievec = $dovecot::sievec,
Optional[String] $source = undef,
) {
file { "dovecot sieve ${title}":
path => $path,
owner => $owner,
group => $group,
mode => $mode,
content => $content,
source => $source,
require => Class['dovecot::install'],
}
~> exec { "compile sieve ${title}":
command => "${sievec} ${path}",
user => $owner,
group => $group,
refreshonly => true,
notify => Class['dovecot::service'],
}
}