diff options
author | Marknl <mark@e-rave.nl> | 2016-12-27 12:12:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-27 12:12:10 +0100 |
commit | 78b2f91caf4c7ade2630376c9c326773fdd5ef3c (patch) | |
tree | ca782480caad3321f2e9acb5e909d82a154b730e | |
parent | 45c62306c1e0a3749a06db14deb4c7eb10cf9bee (diff) |
Conntrack helper
-rw-r--r-- | manifests/conntrack/helper.pp | 32 |
1 files changed, 32 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" + } +} |