-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make before
setting in jail.conf configurable
#68
Conversation
Fixed the failing tests |
Hi @arjenz, can you please rebase against our latest master branch? |
@bastelfreak Done :) |
manifests/init.pp
Outdated
@@ -15,6 +15,7 @@ | |||
String $config_file_owner = $::fail2ban::params::config_file_owner, | |||
String $config_file_group = $::fail2ban::params::config_file_group, | |||
String $config_file_mode = $::fail2ban::params::config_file_mode, | |||
String $config_file_before = $::fail2ban::params::before_file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use String[1]
? This ensures people don't provide an empty string.
manifests/params.pp
Outdated
@@ -41,6 +41,12 @@ | |||
default => 'Package[fail2ban]', | |||
} | |||
|
|||
$before_file = $::osfamily ? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use $facts['os']['family']
instead. The new facts hash is preferred to access facts.
manifests/params.pp
Outdated
@@ -41,6 +41,12 @@ | |||
default => 'Package[fail2ban]', | |||
} | |||
|
|||
$before_file = $::osfamily ? { | |||
'Debian' => 'paths-debian.conf', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome that you use a selector here to determine the value for $before_file. That is the right way to go, but rarely used.
@@ -19,7 +19,7 @@ | |||
|
|||
[INCLUDES] | |||
|
|||
before = paths-fedora.conf | |||
before = <%= scope['::fail2ban::before_file'] %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please mind that this is now an epp template and variables are accessed in a different way:
https://puppet.com/docs/puppet/5.5/lang_template_epp.html
91b4748
to
69fcaea
Compare
@bastelfreak Done, I think :) |
"before" File is called 'paths-debian.conf' on osfamily Debian, add this setting to params, init and template.
Don't allow empty string as parameter values.
@bastelfreak Anything else I can do? :) |
looks good, thanks! |
"before" File is called 'paths-debian.conf' on osfamily Debian, add this setting to params, init and template.
Pull Request (PR) description
Account for different filenames on different operating systems fore the "before" include in jails.conf
This Pull Request (PR) fixes the following issues