17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'manifests/file.pp', line 17
define nftables::file (
String[1] $label = $title,
Optional[String] $content = undef,
Optional[Variant[String,Array[String,1]]] $source = undef,
String $prefix = 'file-',
) {
if $content and $source {
fail('Please pass only $content or $source, not both.')
}
$concat_name = "nftables-${name}"
Package['nftables'] -> file { "/etc/nftables/puppet-preflight/${prefix}${label}.nft":
ensure => file,
owner => root,
group => root,
mode => $nftables::default_config_mode,
content => $content,
source => $source,
} ~> Exec['nft validate'] -> file { "/etc/nftables/puppet/${prefix}${label}.nft":
ensure => file,
owner => root,
group => root,
mode => $nftables::default_config_mode,
content => $content,
source => $source,
} ~> Service['nftables']
}
|