summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorduritong <peter.meier+github@immerda.ch>2017-01-14 13:30:14 +0100
committerGitHub <noreply@github.com>2017-01-14 13:30:14 +0100
commit85b6e3820fa614eeafb99b85846172553461398e (patch)
tree2e15dc1d3de8306c073f2413b3b543b90356d041 /manifests
parentadd8f6677a21940cddd0f88396d6e1a152634f54 (diff)
parent07f4d8f14ac5224ba900d27f51cd4ae8121f1578 (diff)
Merge pull request #13 from marknl/master
Conntrack support
Diffstat (limited to 'manifests')
-rw-r--r--manifests/conntrack/helper.pp32
-rw-r--r--manifests/init.pp2
2 files changed, 34 insertions, 0 deletions
diff --git a/manifests/conntrack/helper.pp b/manifests/conntrack/helper.pp
new file mode 100644
index 0000000..ea7fb2e
--- /dev/null
+++ b/manifests/conntrack/helper.pp
@@ -0,0 +1,32 @@
+# Class for managing conntrack file: Helpers
+#
+# See http://shorewall.net/manpages/shorewall-conntrack.html for more info.
+# The $name defines the helper, so this needs to match one of the helpers
+# in the documentation.
+define shorewall::conntrack::helper(
+ $ensure = present,
+ $options = '',
+ $source = '-',
+ $destination = '-',
+ $proto,
+ $destinationport,
+ $sourceport = '',
+ $user = '',
+ $switch = '',
+ $chain = 'PO',
+ $order
+) {
+
+ $_helper = sprintf("__%s_HELPER", upcase($name))
+ $_chain = ":${chain}"
+ $_options = ''
+
+ if ($options != '') {
+ $_options = "(${options})"
+ }
+
+ shorewall::entry{"conntrack-${order}-${name}":
+ ensure => $ensure,
+ line => "?if ${_helper}\nCT:helper:${name}${_options}${_chain} ${source} ${destination} ${proto} ${destinationport} ${sourceport} ${$user} ${switch}\n?endif"
+ }
+}
diff --git a/manifests/init.pp b/manifests/init.pp
index afdc7d7..aac1520 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -100,6 +100,8 @@ class shorewall(
'tunnels',
# See http://www.shorewall.net/MultiISP.html
'rtrules',
+ # See http://shorewall.net/manpages/shorewall-conntrack.html
+ 'conntrack',
# See http://www.shorewall.net/manpages/shorewall-mangle.html
'mangle',
]:;