diff --git a/modules/mail/manifests/postfix.pp b/modules/mail/manifests/postfix.pp index 8ec14b6c..98b0bb2d 100644 --- a/modules/mail/manifests/postfix.pp +++ b/modules/mail/manifests/postfix.pp @@ -112,7 +112,7 @@ class mail::postfix ( group => 'root', mode => '0644', require => Package['postfix'], - notify => Service['postfix'], + notify => Exec['postmap_virtual'], content => template('mail/postfix/virtual.erb'), } @@ -161,7 +161,9 @@ class mail::postfix ( service { 'postfix': ensure => $ensure_service, enable => true, + hasrestart => true, require => Package['postfix'], + restart => 'systemctl reload postfix', subscribe => File['/etc/resolv.conf'], } @@ -171,6 +173,12 @@ class mail::postfix ( notify => Service['postfix'], } + exec { 'postmap_virtual': + command => '/usr/sbin/postmap /etc/postfix/virtual', + refreshonly => true, + notify => Service['postfix'], + } + exec { 'newaliases': subscribe => File['/etc/aliases'], command => '/usr/bin/newaliases',