Loading manifests/canonical.pp +8 −3 Original line number Diff line number Diff line Loading @@ -31,12 +31,17 @@ # Where to create the file. If not defined "${postfix::confdir}/canonical" # will be used as path. # # @param lookup_table_suffix # Depends on the lookup table type, which is used on the postfix::hash and postfix::config resources. # Defaults to 'db', the suffix of the "hash" type. # # @see https://www.postfix.org/canonical.5.html # define postfix::canonical ( String $destination, Enum['present','absent'] $ensure = 'present', Stdlib::Absolutepath $file = undef Stdlib::Absolutepath $file = undef, String[1] $lookup_table_suffix = 'db', ) { include postfix include postfix::augeas Loading Loading @@ -65,6 +70,6 @@ define postfix::canonical ( lens => 'Postfix_Canonical.lns', changes => $changes, require => [Package['postfix'], Augeas::Lens['postfix_canonical']], notify => Exec["generate ${_file}.db"], notify => Exec["generate ${_file}.${lookup_table_suffix}"], } } manifests/hash.pp +2 −2 Original line number Diff line number Diff line # @summary Creates Postfix hashed "map" files, and builds the corresponding db file # # Creates Postfix hashed "map" files. It will create "${name}", and then build # "${name}.db" using the "postmap" command. The map file can then be referred to # "${name}.<table type suffix>" using the "postmap" command. The map file can then be referred to # using postfix::config. # # @example Creates a virtual hashmap Loading Loading @@ -62,7 +62,7 @@ define postfix::hash ( ensure => $ensure, source => $source, content => $content, type => 'hash', type => $postfix::lookup_table_type, path => $name, mode => $mode, } Loading manifests/init.pp +5 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,10 @@ # A free form string that can define any LDAP options to be passed through (ldap_table(5)). # Example: `start_tls = yes`. # # @param lookup_table_type # Table format type as described in http://www.postfix.org/DATABASE_README.html#types. # Type has to be supported by system, see "postconf -m" for supported types. # # @param mail_user # A string defining the mail user, and optionally group, to execute external commands as. # This parameter maps to the user parameter (pipe(8)). Loading Loading @@ -258,6 +262,7 @@ class postfix ( Optional[String] $ldap_base = undef, Optional[String] $ldap_host = undef, Optional[String] $ldap_options = undef, String $lookup_table_type = 'hash', String $mail_user = 'vmail', # postfix_mail_user Boolean $mailman = false, String $mailx_ensure = 'present', Loading manifests/mailman.pp +2 −2 Original line number Diff line number Diff line Loading @@ -12,9 +12,9 @@ class postfix::mailman { postfix::config { 'virtual_alias_maps': value => "hash:${postfix::confdir}/virtual"; value => "${postfix::lookup_table_type}:${postfix::confdir}/virtual"; 'transport_maps': value => "hash:${postfix::confdir}/transport"; value => "${postfix::lookup_table_type}:${postfix::confdir}/transport"; 'mailman_destination_recipient_limit': value => '1'; } Loading manifests/map.pp +14 −6 Original line number Diff line number Diff line Loading @@ -55,12 +55,20 @@ define postfix::map ( fail 'You must provide either \'source\' or \'content\', not both' } $_generated_suffix = $type ? { 'cdb' => 'cdb', 'dbm' => 'dir', 'lmdb' => 'lmdb', 'sdbm' => 'dir', default => 'db', } # CIDR and PCRE maps need a postfix reload, but not a postmap if $type =~ /^(cidr|pcre|regexp)$/ { $manage_notify = Service['postfix'] } else { if $ensure == 'present' { $manage_notify = Exec["generate ${name}.db"] $manage_notify = Exec["generate ${name}.${_generated_suffix}"] } else { $manage_notify = undef } Loading @@ -79,9 +87,9 @@ define postfix::map ( } if $type !~ /^(cidr|pcre|regexp)$/ { file { "postfix map ${name}.db": file { "postfix map ${name}.${_generated_suffix}": ensure => $ensure, path => "${_path}.db", path => "${_path}.${_generated_suffix}", owner => 'root', group => 'postfix', mode => $mode, Loading @@ -91,11 +99,11 @@ define postfix::map ( } $generate_cmd = $ensure ? { 'absent' => "rm ${_path}.db", 'present' => "postmap ${_path}", 'absent' => "rm ${_path}.${_generated_suffix}", 'present' => "postmap ${type}:${_path}", } exec { "generate ${name}.db": exec { "generate ${name}.${_generated_suffix}": command => $generate_cmd, path => $facts['path'], #creates => "${name}.db", # this prevents postmap from being run ! Loading Loading
manifests/canonical.pp +8 −3 Original line number Diff line number Diff line Loading @@ -31,12 +31,17 @@ # Where to create the file. If not defined "${postfix::confdir}/canonical" # will be used as path. # # @param lookup_table_suffix # Depends on the lookup table type, which is used on the postfix::hash and postfix::config resources. # Defaults to 'db', the suffix of the "hash" type. # # @see https://www.postfix.org/canonical.5.html # define postfix::canonical ( String $destination, Enum['present','absent'] $ensure = 'present', Stdlib::Absolutepath $file = undef Stdlib::Absolutepath $file = undef, String[1] $lookup_table_suffix = 'db', ) { include postfix include postfix::augeas Loading Loading @@ -65,6 +70,6 @@ define postfix::canonical ( lens => 'Postfix_Canonical.lns', changes => $changes, require => [Package['postfix'], Augeas::Lens['postfix_canonical']], notify => Exec["generate ${_file}.db"], notify => Exec["generate ${_file}.${lookup_table_suffix}"], } }
manifests/hash.pp +2 −2 Original line number Diff line number Diff line # @summary Creates Postfix hashed "map" files, and builds the corresponding db file # # Creates Postfix hashed "map" files. It will create "${name}", and then build # "${name}.db" using the "postmap" command. The map file can then be referred to # "${name}.<table type suffix>" using the "postmap" command. The map file can then be referred to # using postfix::config. # # @example Creates a virtual hashmap Loading Loading @@ -62,7 +62,7 @@ define postfix::hash ( ensure => $ensure, source => $source, content => $content, type => 'hash', type => $postfix::lookup_table_type, path => $name, mode => $mode, } Loading
manifests/init.pp +5 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,10 @@ # A free form string that can define any LDAP options to be passed through (ldap_table(5)). # Example: `start_tls = yes`. # # @param lookup_table_type # Table format type as described in http://www.postfix.org/DATABASE_README.html#types. # Type has to be supported by system, see "postconf -m" for supported types. # # @param mail_user # A string defining the mail user, and optionally group, to execute external commands as. # This parameter maps to the user parameter (pipe(8)). Loading Loading @@ -258,6 +262,7 @@ class postfix ( Optional[String] $ldap_base = undef, Optional[String] $ldap_host = undef, Optional[String] $ldap_options = undef, String $lookup_table_type = 'hash', String $mail_user = 'vmail', # postfix_mail_user Boolean $mailman = false, String $mailx_ensure = 'present', Loading
manifests/mailman.pp +2 −2 Original line number Diff line number Diff line Loading @@ -12,9 +12,9 @@ class postfix::mailman { postfix::config { 'virtual_alias_maps': value => "hash:${postfix::confdir}/virtual"; value => "${postfix::lookup_table_type}:${postfix::confdir}/virtual"; 'transport_maps': value => "hash:${postfix::confdir}/transport"; value => "${postfix::lookup_table_type}:${postfix::confdir}/transport"; 'mailman_destination_recipient_limit': value => '1'; } Loading
manifests/map.pp +14 −6 Original line number Diff line number Diff line Loading @@ -55,12 +55,20 @@ define postfix::map ( fail 'You must provide either \'source\' or \'content\', not both' } $_generated_suffix = $type ? { 'cdb' => 'cdb', 'dbm' => 'dir', 'lmdb' => 'lmdb', 'sdbm' => 'dir', default => 'db', } # CIDR and PCRE maps need a postfix reload, but not a postmap if $type =~ /^(cidr|pcre|regexp)$/ { $manage_notify = Service['postfix'] } else { if $ensure == 'present' { $manage_notify = Exec["generate ${name}.db"] $manage_notify = Exec["generate ${name}.${_generated_suffix}"] } else { $manage_notify = undef } Loading @@ -79,9 +87,9 @@ define postfix::map ( } if $type !~ /^(cidr|pcre|regexp)$/ { file { "postfix map ${name}.db": file { "postfix map ${name}.${_generated_suffix}": ensure => $ensure, path => "${_path}.db", path => "${_path}.${_generated_suffix}", owner => 'root', group => 'postfix', mode => $mode, Loading @@ -91,11 +99,11 @@ define postfix::map ( } $generate_cmd = $ensure ? { 'absent' => "rm ${_path}.db", 'present' => "postmap ${_path}", 'absent' => "rm ${_path}.${_generated_suffix}", 'present' => "postmap ${type}:${_path}", } exec { "generate ${name}.db": exec { "generate ${name}.${_generated_suffix}": command => $generate_cmd, path => $facts['path'], #creates => "${name}.db", # this prevents postmap from being run ! Loading