X-Git-Url: https://pwan.org/git/?p=hgr.git;a=blobdiff_plain;f=manifests%2Fpostfix.pp;fp=manifests%2Fpostfix.pp;h=9bee27551f3319d17bb7acdc579fcd6cf4fcafce;hp=0000000000000000000000000000000000000000;hb=cb5a94b9d4662bcb79cc59e23c9d3f1bbdb31cc5;hpb=8e287a49e4932a8a9b7b20b4372225a9d5ea5bd9 diff --git a/manifests/postfix.pp b/manifests/postfix.pp new file mode 100644 index 0000000..9bee275 --- /dev/null +++ b/manifests/postfix.pp @@ -0,0 +1,60 @@ +class hgr::postfix { + + package { + "exim4": + ensure => absent; + "postfix": + ensure => installed; + "sasl2-bin": + ensure => installed; + "libsasl2-2": + ensure => installed; + "libsasl2-modules": + ensure => installed; + "procmail": + ensure => installed; + } + + file { + + "/etc/postfix/main.cf": + ensure => present, + content => template("hgr/postfix/main.cf.erb"), + owner => "root", + group => "root", + mode => "0644", + notify => Service["postfix"], + require => [Package["postfix"],File["/etc/ssl/certs/${::fqdn}.pem"],File["/etc/ssl/private/${::fqdn}.key"],File["/etc/ssl/certs/${::fqdn}-CA.pem"]]; + + "/etc/postfix/master.cf": + ensure => present, + source => "puppet:///modules/hgr/postfix/master.cf", + owner => "root", + group => "root", + mode => "0644", + notify => Service["postfix"], + require => [Package["postfix","spamassassin"]]; + # TODO: need to run portmap on this file after updating it / before restarting postfix + "/etc/postfix/send_access": + ensure => present, + owner => "root", + group => "root", + mode => "0644", + notify => Service["postfix"], + require => Package["postfix"]; + "/etc/procmailrc": + ensure => present, + source => "puppet:///modules/hgr/procmailrc", + owner => "root", + group => "root", + mode => "0644", + require => Package["procmail"]; + } + + service { + "postfix": + ensure => running, + enable => true, + require => Package["postfix"]; + } +}