root / manifests / rules / out / icmp.pp @ 11bf7237
Historique | Voir | Annoter | Télécharger (956 octets)
1 |
class nftables::rules::out::icmp ( |
---|---|
2 |
Optional[Array[String]] $v4_types = undef, |
3 |
Optional[Array[String]] $v6_types = undef, |
4 |
String $order = '10', |
5 |
) { |
6 |
if $v4_types { |
7 |
$v4_types.each | String $icmp_type | { |
8 |
nftables::rule { |
9 |
'default_out-accept_icmpv4': |
10 |
content => "ip protocol icmp icmp type ${icmp_type} accept", |
11 |
order => $order, |
12 |
} |
13 |
} |
14 |
} else { |
15 |
nftables::rule { |
16 |
'default_out-accept_icmpv4': |
17 |
content => 'ip protocol icmp accept', |
18 |
order => $order, |
19 |
} |
20 |
} |
21 |
|
22 |
if $v6_types { |
23 |
$v6_types.each | String $icmp_type | { |
24 |
nftables::rule { |
25 |
'default_out-accept_icmpv6': |
26 |
content => "ip6 nexthdr ipv6-icmp icmpv6 type ${icmp_type} accept", |
27 |
order => $order, |
28 |
} |
29 |
} |
30 |
} else { |
31 |
nftables::rule { |
32 |
'default_out-accept_icmpv6': |
33 |
content => 'ip6 nexthdr ipv6-icmp accept', |
34 |
order => $order, |
35 |
} |
36 |
} |
37 |
} |