Projet

Général

Profil

Révision 66ed7f61

ID66ed7f614de10e14ab9a911c90cdef4d26b4b7e3
Parent 66b1a7a9
Enfant 2c00d766

Ajouté par mh il y a plus de 4 ans

migrate create_resource to the generic loop over hash approach

create_resource is notorious for not providing exact line/file info
when something fails. Since in puppet you can now loop over hashes
and you have the splat assignment operator. This means you get much
better context when going this way.

Voir les différences:

manifests/init.pp
71 71
  include nftables::ip_nat
72 72

  
73 73
  # inject custom rules e.g. from hiera
74
  create_resources(nftables::rule, $rules)
74
  $rules.each |$n,$v| {
75
    nftables::rule{
76
      $n:
77
        * => $v
78
    }
79
  }
75 80
}

Formats disponibles : Unified diff