Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / templates / config / puppet.nft.epp @ 7b9d6ffc

Historique | Voir | Annoter | Télécharger (1023 octets)

1
<%- |
2
  Boolean $inet_filter,
3
  Boolean $nat,
4
  Optional[Array[String[1],1]] $noflush = undef,
5
|-%>
6
<%-
7
if $noflush and $facts['nftables'] and $facts['nftables']['tables'] {
8
 $_flush_command = $facts['nftables']['tables'].filter |$_tab| { ! ($_tab in $noflush) }.map |$_table| {
9
   [ "table ${regsubst($_table,'-',' ')} {}", "flush table ${regsubst($_table,'-',' ')}" ]
10
 }.flatten
11
} else {
12
 $_flush_command = ['flush ruleset']
13
}
14
-%>
15
# puppet-preflight.nft is only used by puppet for validating new configs
16
# puppet.nft is real configuration that the nftables services uses.
17
# To process either the -I flag must be specified.
18
# nft -c -I /etc/nftables/puppet -f /etc/nftables/puppet.nft
19
# nft -c -I /etc/nftables/puppet-preflight -f /etc/nftables/puppet-preflight.nft
20

    
21
# drop any existing nftables ruleset, ensure tables are initialized
22
<%= $_flush_command.join("\n") %>
23

    
24
include "custom-*.nft"
25
<% if $inet_filter { -%>
26
include "inet-filter.nft"
27
<% } -%>
28
<% if $nat { -%>
29
include "ip-nat.nft"
30
include "ip6-nat.nft"
31
<% } -%>