1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'manifests/rules/icmp.pp', line 1
class nftables::rules::icmp (
# lint:ignore:parameter_documentation
Optional[Array[String]] $v4_types = undef,
Optional[Array[String]] $v6_types = undef,
String $order = '10',
# lint:endignore
) {
if $v4_types {
$v4_types.each | String $icmp_type | {
nftables::rule {
"default_in-accept_icmpv4_${regsubst(split($icmp_type, ' ')[0], '-', '_', 'G')}":
content => "ip protocol icmp icmp type ${icmp_type} accept",
order => $order,
}
}
} else {
nftables::rule {
'default_in-accept_icmpv4':
content => 'ip protocol icmp accept',
order => $order,
}
}
if $v6_types {
$v6_types.each | String $icmp_type | {
nftables::rule {
"default_in-accept_icmpv6_${regsubst(split($icmp_type, ' ')[0], '-', '_', 'G')}":
content => "ip6 nexthdr ipv6-icmp icmpv6 type ${icmp_type} accept",
order => $order,
}
}
} else {
nftables::rule {
'default_in-accept_icmpv6':
content => 'ip6 nexthdr ipv6-icmp accept',
order => $order,
}
}
}
|