Puppet Class: sendmail::mailertable
- Defined in:
- manifests/mailertable.pp
Overview
Class: sendmail::mailertable
Manage the Sendmail mailertable db file.
Parameters:
- content
-
The desired contents of the mailertable file. This allows managing the mailertable file as a whole. Changes to the file automatically triggers a rebuild of the mailertable database file. This attribute is mutually exclusive with ‘source’.
- source
-
A source file for the mailertable file. This allows managing the mailertable file as a whole. Changes to the file automatically triggers a rebuild of the mailertable database file. This attribute is mutually exclusive with ‘content’.
- entries
-
A hash that will be used to create sendmail::mailertable::entry resources. This class can be used to create mailertable entries defined in hiera. The hiera hash should look like this:
sendmail::mailertable::entries:
'.example.com': value: 'smtp:relay.example.com' 'www.example.org': value: 'relay:relay.example.com' '.example.net': value: 'error:5.7.0:550 mail is not accepted'
Requires:
Nothing.
Sample Usage:
class { 'sendmail::mailertable': }
class { 'sendmail::mailertable':
source => 'puppet:///modules/sendmail/mailertable',
}
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 |
# File 'manifests/mailertable.pp', line 45
class sendmail::mailertable (
Optional[String] $content = undef,
Optional[String] $source = undef,
Hash[String,Data] $entries = {},
) {
if ($content and $source) {
fail('You cannot specify more than one of content, source, entries')
}
if ($content or $source) {
if !empty($entries) {
fail('You cannot specify more than one of content, source, entries')
}
class { 'sendmail::mailertable::file':
content => $content,
source => $source,
}
}
elsif !empty($entries) {
$entries.each |$entry,$attributes| {
sendmail::mailertable::entry { $entry:
* => $attributes,
}
}
}
}
|