Commit aa9b5993 authored by mh's avatar mh
Browse files

fix #45 - add custom_file define

parent 3d066ead
Pipeline #4902 failed with stages
in 1 minute and 16 seconds
# manage a custom config file as it is
define nftables::custom_file (
Optional[String] $content = undef,
Optional[Variant[String,Array[String,1]]] $source = undef,
) {
Package['nftables'] -> file {
"/etc/nftables/puppet-preflight/${name}.nft":
owner => root,
group => root,
mode => '0640',
} ~> Exec['nft validate'] -> file {
"/etc/nftables/puppet/${name}.nft":
ensure => file,
source => "/etc/nftables/puppet-preflight/${name}.nft",
owner => root,
group => root,
mode => '0640',
} ~> Service['nftables']
if $source {
File["/etc/nftables/puppet-preflight/${name}.nft"]{
source => $source,
}
} else {
File["/etc/nftables/puppet-preflight/${name}.nft"]{
content => $content,
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment