Projet

Général

Profil

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

root / manifests / rules / out / icmp.pp @ f9de4dee

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

1
# @summary control outbound icmp packages
2
class nftables::rules::out::icmp (
3
  # lint:ignore:parameter_documentation
4
  Optional[Array[String]] $v4_types = undef,
5
  Optional[Array[String]] $v6_types = undef,
6
  String $order = '10',
7
  # lint:endignore
8
) {
9
  if $v4_types {
10
    $v4_types.each | String $icmp_type | {
11
      nftables::rule { 'default_out-accept_icmpv4':
12
        content => "ip protocol icmp icmp type ${icmp_type} accept",
13
        order   => $order,
14
      }
15
    }
16
  } else {
17
    nftables::rule { 'default_out-accept_icmpv4':
18
      content => 'ip protocol icmp accept',
19
      order   => $order,
20
    }
21
  }
22

    
23
  if $v6_types {
24
    $v6_types.each | String $icmp_type | {
25
      nftables::rule { '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 { 'default_out-accept_icmpv6':
32
      content => 'ip6 nexthdr ipv6-icmp accept',
33
      order   => $order,
34
    }
35
  }
36
}