]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Adding firewall rules for mumble and jabber vservers
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 15 Apr 2012 21:05:24 +0000 (18:05 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 15 Apr 2012 21:05:24 +0000 (18:05 -0300)
manifests/subsystems/firewall/vserver.pp
manifests/vserver.pp

index 92f7542e960acc20159da41243c386080f8d7ea8..cef8748e127a05a5aafa5b460f779ac588a85c0e 100644 (file)
@@ -375,3 +375,81 @@ class firewall::vserver::tor($destination, $zone = 'fw') {
     order           => '2103',
   }
 }
+
+class firewall::vserver::jabber($destination, $zone = 'fw') {
+  shorewall::rule { 'jabber-0':
+    action          => 'DNAT',
+    source          => 'net',
+    destination     => "$zone:$destination:5222",
+    proto           => 'tcp',
+    destinationport => '5222',
+    ratelimit       => '-',
+    order           => '2200',
+  }
+
+  shorewall::rule { 'jabber-1':
+    action          => 'DNAT',
+    source          => '$FW',
+    destination     => "$zone:$destination:5223",
+    proto           => 'tcp',
+    destinationport => '5223',
+    originaldest    => "$ipaddress",
+    ratelimit       => '-',
+    order           => '2201',
+  }
+
+  shorewall::rule { 'jabber-2':
+    action          => 'DNAT',
+    source          => 'net',
+    destination     => "$zone:$destination:5269",
+    proto           => 'tcp',
+    destinationport => '5269',
+    ratelimit       => '-',
+    order           => '2202',
+  }
+
+  shorewall::rule { 'jabber-3':
+    action          => 'DNAT',
+    source          => '$FW',
+    destination     => "$zone:$destination:4369",
+    proto           => 'tcp',
+    destinationport => '4369',
+    originaldest    => "$ipaddress",
+    ratelimit       => '-',
+    order           => '2203',
+  }
+
+  shorewall::rule { 'jabber-4':
+    action          => 'DNAT',
+    source          => '$FW',
+    destination     => "$zone:$destination:4370",
+    proto           => 'tcp',
+    destinationport => '4370:4375',
+    originaldest    => "$ipaddress",
+    ratelimit       => '-',
+    order           => '2204',
+  }
+}
+
+class firewall::vserver::mumble($destination, $zone = 'fw') {
+  shorewall::rule { 'mumble-0':
+    action          => 'DNAT',
+    source          => 'net',
+    destination     => "$zone:$destination:64738",
+    proto           => 'tcp',
+    destinationport => '64738',
+    ratelimit       => '-',
+    order           => '2300',
+  }
+
+  shorewall::rule { 'mumble-1':
+    action          => 'DNAT',
+    source          => '$FW',
+    destination     => "$zone:$destination:64738",
+    proto           => 'tcp',
+    destinationport => '64738',
+    originaldest    => "$ipaddress",
+    ratelimit       => '-',
+    order           => '2301',
+  }
+}
index 99a8481530bbfe55ec026c5c818a27f3afc3cc8a..938903a801445f0584c7b020dba88fb5e8fd2d9b 100644 (file)
@@ -47,7 +47,8 @@ class nodo::vserver inherits nodo {
                   $puppetmaster = false, $gitd = false, $mail = false,
                   $icecast = false, $sound = false, $tor = false,
                   $ticket = false, $memory_limit = false, $distro = 'squeeze',
-                  $dns = false, $munin_port = false, $monkeysphere_ssh_port = false) {
+                  $dns = false, $munin_port = false, $monkeysphere_ssh_port = false,
+                  $jabber = false, $mumble = false) {
 
     # set instance id
     if $context <= 9 {
@@ -198,6 +199,18 @@ class nodo::vserver inherits nodo {
             "firewall::vserver::tor": destination => "192.168.0.$context";
           }
         }
+
+        if $jabber {
+          class {
+            "firewall::vserver::jabber": destination => "192.168.0.$context";
+          }
+        }
+
+        if $mumble {
+          class {
+            "firewall::vserver::mumble": destination => "192.168.0.$context";
+          }
+        }
       }
     }
   }