From 8e4920c3ceef338432fa01f1f8d2f6597f9fff05 Mon Sep 17 00:00:00 2001 From: Thore Bödecker Date: Wed, 11 Sep 2019 16:07:44 +0200 Subject: expose parameter to initialize custom chains Previously it was not possible to define custom chains with parameter, e.g. in order to collect them from hiera. This commit adds this functionality, just like it was already in place for ferm::rules. --- manifests/init.pp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index d2251c9..2f5e1ef 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -55,6 +55,9 @@ # @param rules A hash that holds all data for ferm::rule # Default value: Empty Hash # Allowed value: Any Hash +# @param chains A hash that holds all data for ferm::chain +# Default value: Empty Hash +# Allowed value: Any Hash # @param forward_log_dropped_packets Enable/Disable logging in the FORWARD chain of packets to the kernel log, if no explicit chain matched # Default value: false # Allowed values: (true|false) @@ -84,6 +87,7 @@ class ferm ( Boolean $output_log_dropped_packets, Boolean $input_log_dropped_packets, Hash $rules, + Hash $chains, Array[Enum['ip','ip6']] $ip_versions, Hash[String[1],Array[String[1]]] $preserve_chains_in_tables, ) { @@ -98,6 +102,12 @@ class ferm ( Ferm::Chain <| |> ~> Class['ferm::service'] + $chains.each |$chainname, $attributes| { + ferm::chain{$chainname: + * => $attributes, + } + } + $rules.each |$rulename, $attributes| { ferm::rule{$rulename: * => $attributes, -- cgit v1.2.3