]> gitweb.fluxo.info Git - puppet-firewall.git/commitdiff
Adds firewall::router::rsync
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 16 Oct 2015 20:42:08 +0000 (17:42 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 16 Oct 2015 20:42:08 +0000 (17:42 -0300)
manifests/router/rsync.pp [new file with mode: 0644]

diff --git a/manifests/router/rsync.pp b/manifests/router/rsync.pp
new file mode 100644 (file)
index 0000000..e185981
--- /dev/null
@@ -0,0 +1,29 @@
+define firewall::router::rsync($destination, $port_orig = '873', $port_dest = '', $zone = 'loc',
+                             $originaldest = $ipaddress) {
+  shorewall::rule { "rsync-$name-1":
+    action          => 'DNAT',
+    source          => 'net',
+    destination     => $port_dest ? {
+      ''      => "$zone:$destination",
+      default => "$zone:$destination:$port_dest",
+    },
+    proto           => 'tcp',
+    destinationport => "$port_orig",
+    ratelimit       => '-',
+    order           => "26$port_orig",
+  }
+
+  shorewall::rule { "rsync-$name-2":
+    action          => 'DNAT',
+    source          => '$FW',
+    destination     => $port_dest ? {
+      ''      => "$zone:$destination",
+      default => "$zone:$destination:$port_dest",
+    },
+    proto           => 'tcp',
+    destinationport => "$port_orig",
+    originaldest    => "$originaldest",
+    ratelimit       => '-',
+    order           => "26$port_orig",
+  }
+}