root / templates / config / puppet.nft.epp @ bd5145ab
Historique | Voir | Annoter | Télécharger (881 octets)
1 |
<%- | |
---|---|
2 |
Boolean $nat, |
3 |
Optional[Array[String[1],1]] $noflush = undef, |
4 |
|-%> |
5 |
<%- |
6 |
if $noflush and $facts['nftables'] and $facts['nftables']['tables'] { |
7 |
$_flush_command = $facts['nftables']['tables'].filter |$_tab| { ! ($_tab in $noflush) }.map |$_table| { |
8 |
"flush table ${regsubst($_table,'-',' ')}" |
9 |
} |
10 |
} else { |
11 |
$_flush_command = ['flush ruleset'] |
12 |
} |
13 |
-%> |
14 |
# puppet-preflight.nft is only used by puppet for validating new configs |
15 |
# puppet.nft is real configuration that the nftables services uses. |
16 |
# To process either the -I flag must be specified. |
17 |
# nft -c -I /etc/nftables/puppet -f /etc/nftables/puppet.nft |
18 |
# nft -c -I /etc/nftables/puppet-preflight -f /etc/nftables/puppet-preflight.nft |
19 |
|
20 |
# drop any existing nftables ruleset |
21 |
<%= $_flush_command.join('; ') %> |
22 |
|
23 |
include "custom-*.nft" |
24 |
include "inet-filter.nft" |
25 |
<% if $nat { -%> |
26 |
include "ip-nat.nft" |
27 |
include "ip6-nat.nft" |
28 |
<% } -%> |