Merge branch 'master' of ssh://pwan.org/var/www/git/projects/hgr
[hgr.git] / manifests / postfix.pp
diff --git a/manifests/postfix.pp b/manifests/postfix.pp
new file mode 100644 (file)
index 0000000..9bee275
--- /dev/null
@@ -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"];
+  }
+}