Révision 66ed7f61
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.
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