Skip to content

Commit

Permalink
Support ip[6]tables protocol in firewallchain
Browse files Browse the repository at this point in the history
This mirrors the values accepted for the firewall provider.
  • Loading branch information
jcharaoui committed Feb 23, 2024
1 parent 982528e commit 0da8f31
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/puppet/provider/firewallchain/firewallchain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class Puppet::Provider::Firewallchain::Firewallchain
# Command to list all chains and rules
$list_command = {
'IPv4' => 'iptables-save',
'IPv6' => 'ip6tables-save'
'iptables' => 'iptables-save',
'IPv6' => 'ip6tables-save',
'ip6tables' => 'ip6tables-save'
}
# Regex used to divide output of$list_command between tables
$table_regex = %r{(\*(?:nat|mangle|filter|raw|rawpost|broute|security)[^*]+)}
Expand All @@ -20,7 +22,9 @@ class Puppet::Provider::Firewallchain::Firewallchain
# Base commands for the protocols, including table affixes
$base_command = {
'IPv4' => 'iptables -t',
'IPv6' => 'ip6tables -t'
'iptables' => 'iptables -t',
'IPv6' => 'ip6tables -t',
'ip6tables' => 'ip6tables -t',
}
# Command to create a chain
$chain_create_command = '-N'
Expand Down

0 comments on commit 0da8f31

Please sign in to comment.