aboutsummaryrefslogtreecommitdiff
path: root/manifests/chain.pp
diff options
context:
space:
mode:
authorThore Bödecker <me@foxxx0.de>2019-09-13 12:15:19 +0200
committerThore Bödecker <me@foxxx0.de>2019-09-13 12:48:40 +0200
commit3117ba0822e5472b9aa2a3e6e6ef4c43ea4c6565 (patch)
tree1e8f31e85edaa9c7aeec9fae4718e9130d156be3 /manifests/chain.pp
parent1d02a062e30ffdc94a739a7280a4b124c329620d (diff)
downloadpuppet-ferm-3117ba0822e5472b9aa2a3e6e6ef4c43ea4c6565.tar.gz
puppet-ferm-3117ba0822e5472b9aa2a3e6e6ef4c43ea4c6565.tar.bz2
fix kernel incompatibilities
Certain kernel modules and thus iptables functionality was introduced at later releases, so we need to properly reflect that in our default chain initialization procedure. `INPUT` chain for `nat` table was introduced with 2.6.36 `ip6table_nat` kernel module for NAT functionality with IPv6 was introduced with 3.17 This commit implements the required conditional constraints and includes the rspec tests to validate it.
Diffstat (limited to 'manifests/chain.pp')
-rw-r--r--manifests/chain.pp11
1 files changed, 7 insertions, 4 deletions
diff --git a/manifests/chain.pp b/manifests/chain.pp
index a01b9b4..10cc9c1 100644
--- a/manifests/chain.pp
+++ b/manifests/chain.pp
@@ -18,12 +18,15 @@
# @param table Select the target table (filter/raw/mangle/nat)
# Default value: 'filter'
# Allowed values: (filter|raw|mangle|nat) (see Ferm::Tables type)
+# @param ip_versions Set list of versions of ip we want ot use.
+# Default value: $ferm::ip_versions
define ferm::chain (
Boolean $disable_conntrack,
Boolean $log_dropped_packets,
- String[1] $chain = $name,
- Optional[Ferm::Policies] $policy = undef,
- Ferm::Tables $table = 'filter',
+ String[1] $chain = $name,
+ Optional[Ferm::Policies] $policy = undef,
+ Ferm::Tables $table = 'filter',
+ Array[Enum['ip','ip6']] $ip_versions = $ferm::ip_versions,
) {
# prevent unmanaged files due to new naming schema
# keep the default "filter" chains in the original location
@@ -74,7 +77,7 @@ define ferm::chain (
target => $ferm::configfile,
content => epp(
"${module_name}/ferm-table-chain-config-include.epp", {
- 'ip' => join($ferm::ip_versions, ' '),
+ 'ip' => join($ip_versions, ' '),
'table' => $table,
'chain' => $chain,
'filename' => $filename,