Defined Type: sendmail::virtusertable::entry
- Defined in:
- manifests/virtusertable/entry.pp
Summary
Manage an entry in the Sendmail virtusertable db file.Overview
The type has an internal dependency to rebuild the database file.
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 53 |
# File 'manifests/virtusertable/entry.pp', line 25
define sendmail::virtusertable::entry (
Enum['present','absent'] $ensure = 'present',
String $key = $name,
Optional[String] $value = undef,
) {
include sendmail::params
include sendmail::makeall
include sendmail::virtusertable::file
if ($ensure == 'present' and empty($value)) {
fail('value must be set when creating a virtusertable entry')
}
$changes = $ensure ? {
'present' => [
"set key[. = '${key}'] '${key}'",
"set key[. = '${key}']/value '${value}'",
],
'absent' => "rm key[ . = '${key}']",
}
augeas { "${::sendmail::params::virtusertable_file}-${title}":
lens => 'Sendmail_Map.lns',
incl => $::sendmail::params::virtusertable_file,
changes => $changes,
require => Class['sendmail::virtusertable::file'],
notify => Class['sendmail::makeall'],
}
}
|