Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
immerda
Puppet Modules
nftables
Commits
aa9b5993
Commit
aa9b5993
authored
Dec 09, 2020
by
mh
Browse files
fix #45 - add custom_file define
parent
3d066ead
Pipeline
#4902
failed with stages
in 1 minute and 16 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
manifests/custom_file.pp
0 → 100644
View file @
aa9b5993
# 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
,
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment