]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Adding nodo::mail
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 24 Apr 2010 17:00:50 +0000 (14:00 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 24 Apr 2010 17:00:50 +0000 (14:00 -0300)
manifests/mail.pp [new file with mode: 0644]
manifests/vserver.pp

diff --git a/manifests/mail.pp b/manifests/mail.pp
new file mode 100644 (file)
index 0000000..2f4b0ed
--- /dev/null
@@ -0,0 +1,8 @@
+class nodo::mail inherits nodo::vserver {
+  # Class for mail nodes
+  $postfix_relayhost     = "$domain"
+  $postfix_smtp_listen   = "$ip"
+  $postfix_mydestination = "\$myorigin"
+
+  include postfix::mta
+}
index 72406ca27ac72ee7b845db6b66eba10e70dde29c..b8ae60e6f778a2f1bcb556b0967680a67a1ddd94 100644 (file)
@@ -31,7 +31,7 @@ class nodo::vserver inherits nodo {
 
   # Define a vserver instance
   define instance($context, $ensure = 'running', $proxy = false,
-                  $puppetmaster = false, $gitd = false,
+                  $puppetmaster = false, $gitd = false, $mail = false,
                   $icecast = false, $sound = false, $ticket = false,
                   $memory_limit = false) {
 
@@ -308,6 +308,28 @@ class nodo::vserver inherits nodo {
             order           => '901',
           }
         }
+        if $mail {
+          shorewall::rule { 'mail-1':
+            action          => 'DNAT',
+            source          => 'net',
+            destination     => "fw:192.168.0.$context:25",
+            proto           => 'tcp',
+            destinationport => '25',
+            ratelimit       => '-',
+            order           => '1000',
+          }
+
+          shorewall::rule { 'mail-2':
+            action          => 'DNAT',
+            source          => '$FW',
+            destination     => "fw:192.168.0.$context:25",
+            proto           => 'tcp',
+            destinationport => '25',
+            originaldest    => "$ipaddress",
+            ratelimit       => '-',
+            order           => '1001',
+          }
+        }
       }
     }
   }