commit 7030bde09717889131ef8233e6e29171912d1045
Author: Luis Fernández Álvarez <luis.fernandez.alvarez@cern.ch>
Date:   Thu Mar 23 08:12:00 2023 +0100

    Add bridge as a valid family for chain tables

diff --git a/REFERENCE.md b/REFERENCE.md
index 1609edb..006e00b 100644
--- a/REFERENCE.md
+++ b/REFERENCE.md
@@ -153,6 +153,7 @@ The following parameters are available in the `nftables` class:
 * [`configuration_path`](#configuration_path)
 * [`nft_path`](#nft_path)
 * [`echo`](#echo)
+* [`default_config_mode`](#default_config_mode)
 
 ##### <a name="out_all"></a>`out_all`
 
@@ -348,6 +349,13 @@ Data type: `Stdlib::Unixpath`
 
 Path to the echo binary
 
+##### <a name="default_config_mode"></a>`default_config_mode`
+
+Data type: `Stdlib::Filemode`
+
+The default file & dir mode for configuration files and directories. The
+default varies depending on the system, and is set in the module's data.
+
 ### <a name="nftablesbridges"></a>`nftables::bridges`
 
 allow forwarding traffic on bridges
@@ -1166,7 +1174,7 @@ The following parameters are available in the `nftables::chain` defined type:
 
 ##### <a name="table"></a>`table`
 
-Data type: `Pattern[/^(ip|ip6|inet)-[a-zA-Z0-9_]+$/]`
+Data type: `Pattern[/^(ip|ip6|inet|netdev|bridge)-[a-zA-Z0-9_]+$/]`
 
 
 
diff --git a/manifests/chain.pp b/manifests/chain.pp
index b838739..46e73a3 100644
--- a/manifests/chain.pp
+++ b/manifests/chain.pp
@@ -1,7 +1,7 @@
 # manage a chain
 define nftables::chain (
   # lint:ignore:parameter_documentation
-  Pattern[/^(ip|ip6|inet|netdev)-[a-zA-Z0-9_]+$/] $table = 'inet-filter',
+  Pattern[/^(ip|ip6|inet|netdev|bridge)-[a-zA-Z0-9_]+$/] $table = 'inet-filter',
   Pattern[/^[a-zA-Z0-9_]+$/] $chain = $title,
   Optional[Pattern[/^\d\d-[a-zA-Z0-9_]+$/]] $inject = undef,
   Optional[String] $inject_iif = undef,
diff --git a/spec/defines/chain_spec.rb b/spec/defines/chain_spec.rb
index 6847b76..854ce14 100644
--- a/spec/defines/chain_spec.rb
+++ b/spec/defines/chain_spec.rb
@@ -61,48 +61,50 @@ describe 'nftables::chain' do
         )
       }
 
-      context('with table set to ip6-foo') do
-        let(:params) do
-          {
-            table: 'ip6-foo',
-          }
-        end
+      %w[ip ip6 inet bridge netdev].each do |family|
+        context("with table set to #{family}-foo") do
+          let(:params) do
+            {
+              table: "#{family}-foo",
+            }
+          end
 
-        it {
-          expect(subject).to contain_concat('nftables-ip6-foo-chain-MYCHAIN').with(
-            path: '/etc/nftables/puppet-preflight/ip6-foo-chain-MYCHAIN.nft',
-            owner: 'root',
-            group: 'root',
-            mode: nft_mode,
-            ensure_newline: true
-          )
-        }
+          it {
+            expect(subject).to contain_concat("nftables-#{family}-foo-chain-MYCHAIN").with(
+              path: "/etc/nftables/puppet-preflight/#{family}-foo-chain-MYCHAIN.nft",
+              owner: 'root',
+              group: 'root',
+              mode: nft_mode,
+              ensure_newline: true
+            )
+          }
 
-        it {
-          expect(subject).to contain_file('/etc/nftables/puppet/ip6-foo-chain-MYCHAIN.nft').with(
-            ensure: 'file',
-            source: '/etc/nftables/puppet-preflight/ip6-foo-chain-MYCHAIN.nft',
-            mode: nft_mode,
-            owner: 'root',
-            group: 'root'
-          )
-        }
+          it {
+            expect(subject).to contain_file("/etc/nftables/puppet/#{family}-foo-chain-MYCHAIN.nft").with(
+              ensure: 'file',
+              source: "/etc/nftables/puppet-preflight/#{family}-foo-chain-MYCHAIN.nft",
+              mode: nft_mode,
+              owner: 'root',
+              group: 'root'
+            )
+          }
 
-        it {
-          expect(subject).to contain_concat__fragment('nftables-ip6-foo-chain-MYCHAIN-header').with(
-            order: '00',
-            content: "# Start of fragment order:00 MYCHAIN header\nchain MYCHAIN {",
-            target: 'nftables-ip6-foo-chain-MYCHAIN'
-          )
-        }
+          it {
+            expect(subject).to contain_concat__fragment("nftables-#{family}-foo-chain-MYCHAIN-header").with(
+              order: '00',
+              content: "# Start of fragment order:00 MYCHAIN header\nchain MYCHAIN {",
+              target: "nftables-#{family}-foo-chain-MYCHAIN"
+            )
+          }
 
-        it {
-          expect(subject).to contain_concat__fragment('nftables-ip6-foo-chain-MYCHAIN-footer').with(
-            order: '99',
-            content: "# Start of fragment order:99 MYCHAIN footer\n}",
-            target: 'nftables-ip6-foo-chain-MYCHAIN'
-          )
-        }
+          it {
+            expect(subject).to contain_concat__fragment("nftables-#{family}-foo-chain-MYCHAIN-footer").with(
+              order: '99',
+              content: "# Start of fragment order:99 MYCHAIN footer\n}",
+              target: "nftables-#{family}-foo-chain-MYCHAIN"
+            )
+          }
+        end
       end
 
       context 'with inject set to 22-foobar' do
