diff --git a/manifests/postfix/map.pp b/manifests/postfix/map.pp index 54b2195dc8b970853d35303f0744f29dd756529a..77cf40a37b574aecddaeeb03c62d415bd9b4af48 100644 --- a/manifests/postfix/map.pp +++ b/manifests/postfix/map.pp @@ -2,14 +2,14 @@ # postmap or postalias as needed. Example for a map file: # # base::postfix::map { '/etc/postfix/access/smtp': -# source => 'puppet:///s_emailrouter/etc/postfix/access/smtp', +# source => 'puppet:///modules/s_emailrouter/etc/postfix/access/smtp', # } # # Example for an aliases file, which has to use a different command: # # base::postfix::map { '/etc/postfix/aliases': -# command => 'postalias', -# source => 'puppet:///s_nagios/etc/postfix/aliases', +# command => 'postalias', +# source => 'puppet:///modules/s_nagios/etc/postfix/aliases', # } # # Either source or content can be used with the map. @@ -21,45 +21,44 @@ # actually needs that. define base::postfix::map( - $ensure = 'present', - $command = 'postmap', - $type = 'hash', - $content = undef, - $source = undef) + $ensure = 'present', + $command = 'postmap', + $type = 'hash', + $content = undef, + $source = undef) { - if ($type != 'hash') and ($type != 'btree') { - crit "unknown Postfix map type $type" - } + if ($type != 'hash') and ($type != 'btree') { + crit "unknown Postfix map type $type" + } - file { $name: - ensure => $ensure, - content => $content, - source => $source, - notify => Exec["${command} ${type}:${name}"], - require => Package['postfix'], - } + file { $name: + ensure => $ensure, + content => $content, + source => $source, + notify => Exec["${command} ${type}:${name}"], + require => Package['postfix'], + } - # If ensure is absent, remove the detritus of our hash. - if ($ensure == 'absent') { - file { "${name}.db": ensure => $ensure } - } else { - # We have to define two commands here. The first uses creates and is - # responsible for ensuring that the *.db file always exists (and is - # only defined if the type is hash). The second is called by notify - # and is responsible for updating the hash when the source file - # changes. We need both because a command with a creates stanza won't - # run even if notified if that file already exists. - exec { "${command} ${type}:${name} initial": - command => "${command} ${type}:${name}", - creates => "${name}.db", - require => [ File[$name], File['/etc/postfix/main.cf'], - Package['postfix'] ], - } - exec { "${command} ${type}:${name}": - refreshonly => true, - command => "${command} ${type}:${name}", - require => [ File['/etc/postfix/main.cf'], - Package['postfix'] ], - } + # If ensure is absent, remove the detritus of our hash. + if ($ensure == 'absent') { + file { "${name}.db": ensure => $ensure } + } else { + # We have to define two commands here. The first uses creates and is + # responsible for ensuring that the *.db file always exists (and is only + # defined if the type is hash). The second is called by notify and is + # responsible for updating the hash when the source file changes. We need + # both because a command with a creates stanza won't run even if notified + # if that file already exists. + exec { "${command} ${type}:${name} initial": + command => "${command} ${type}:${name}", + creates => "${name}.db", + require => [ File[$name], File['/etc/postfix/main.cf'], + Package['postfix'] ], + } + exec { "${command} ${type}:${name}": + refreshonly => true, + command => "${command} ${type}:${name}", + require => [ File['/etc/postfix/main.cf'], Package['postfix'] ], } -} \ No newline at end of file + } +}