summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-10-16 17:42:08 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-10-16 17:42:08 -0300
commitddefe2e18b2384f700e9b3ea131added98bc8baa (patch)
treea9095cb9c7d9d2bc34898b51af20ba8ba36384c8
parent94b876ea45394653caa4d14c52d096a4e647659f (diff)
downloadpuppet-firewall-ddefe2e18b2384f700e9b3ea131added98bc8baa.tar.gz
puppet-firewall-ddefe2e18b2384f700e9b3ea131added98bc8baa.tar.bz2
Adds firewall::router::rsync
-rw-r--r--manifests/router/rsync.pp29
1 files changed, 29 insertions, 0 deletions
diff --git a/manifests/router/rsync.pp b/manifests/router/rsync.pp
new file mode 100644
index 0000000..e185981
--- /dev/null
+++ b/manifests/router/rsync.pp
@@ -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",
+ }
+}