Defined Type: postfix::canonical
- Defined in:
- manifests/canonical.pp
Summary
Manage content of the Postfix canonical mapOverview
This type manages content of the /etc/postfix/canonical map.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'manifests/canonical.pp', line 39
define postfix::canonical (
String $destination,
Enum['present','absent'] $ensure = 'present',
Stdlib::Absolutepath $file = undef,
String[1] $lookup_table_suffix = 'db',
) {
include postfix
$_file = pick($file, "${postfix::confdir}/canonical")
case $ensure {
'present': {
$changes = [
"set pattern[. = '${name}'] '${name}'",
"set pattern[. = '${name}']/destination '${destination}'",
]
}
'absent': {
$changes = "rm pattern[. = '${name}']"
}
default: {
fail("Wrong ensure value: ${ensure}")
}
}
augeas { "Postfix canonical - ${name}":
incl => $_file,
lens => 'postfix_canonical.lns',
changes => $changes,
require => Package['postfix'],
notify => Exec["generate ${_file}.${lookup_table_suffix}"],
}
}
|