Projet

Général

Profil

Révision 9f0498e3

ID9f0498e3fd950071f486ac673fc0b091f815ea0b
Parent 0cf43fdf
Enfant 7bb485c5

Ajouté par Nacho Barrientos il y a plus de 4 ans

Relax nftables::set::type making it optional

This is needed in case nftables::set is passed raw configuration via
source or content.

Voir les différences:

manifests/set.pp
1 1
# manage a named set
2 2
define nftables::set(
3
  Enum['ipv4_addr', 'ipv6_addr', 'ether_addr', 'inet_proto', 'inet_service', 'mark']
4
    $type,
5 3
  Enum['present','absent']
6 4
    $ensure = 'present',
7 5
  Pattern[/^[a-zA-Z0-9_]+$/]
8 6
    $setname = $title,
9 7
  Pattern[/^\d\d$/]
10 8
    $order = '10',
9
  Optional[Enum['ipv4_addr', 'ipv6_addr', 'ether_addr', 'inet_proto', 'inet_service', 'mark']]
10
    $type = undef,
11 11
  String
12 12
    $table = 'inet-filter',
13 13
  Array[Enum['constant', 'dynamic', 'interval', 'timeout'], 0, 4]
......
52 52
        source => $source,
53 53
      }
54 54
    } else {
55
      if $type == undef {
56
        fail('The way the resource is configured must have a type set')
57
      }
55 58
      Concat::Fragment["nftables-${table}-set-${setname}"]{
56 59
        content => epp('nftables/set.epp',
57 60
          {

Formats disponibles : Unified diff