-
-
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
Allow changing the ports of the fail2banned services #48
base: master
Are you sure you want to change the base?
Conversation
manifests/init.pp
Outdated
@@ -33,6 +33,7 @@ | |||
$bantime = 432000, | |||
$email = "fail2ban@${::domain}", | |||
$jails = ['ssh', 'ssh-ddos'], | |||
$jail_ports = {}, |
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 add a datatype to the new parmeter.
manifests/init.pp
Outdated
@@ -59,6 +60,7 @@ | |||
|
|||
validate_hash($config_file_hash) | |||
validate_hash($config_file_options_hash) | |||
validate_hash($jail_ports) |
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.
the validate_* method isn't needed when a datatype is used.
@@ -187,7 +187,7 @@ action = %(<%= scope['::fail2ban::action'] %>)s | |||
|
|||
[sshd] | |||
enabled = <%= scope['::fail2ban::jails'].include? "sshd" %> | |||
port = ssh | |||
port = <%= scope['::fail2ban::jail_ports'].key?('sshd') ? scope['::fail2ban::jail_ports']['sshd'] : 'ssh' %> |
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.
The scope method is deprecated, can you instead use this style or convert the template to epp?
Instead of using so many ternary statements we should use a defaults hash, merge that once with $jail_ports
and afterwards directly access the hash in the templates
HI @brunorro, thanks for the PR.Pleas:
|
Dear @brunorro, thanks for the PR! This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase? You can find my sourcecode at voxpupuli/vox-pupuli-tasks |
Dear @brunorro, thanks for the PR! This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase? You can find my sourcecode at voxpupuli/vox-pupuli-tasks |
Pull Request (PR) description
This request allows changing the default port for any service watched by fail2ban. Check Readme.md for the usage of the "ports" parameter.
Most changes made in this request are just ternary operators on templates and the addition of the "ports" parameter hash to init.pp
This Pull Request (PR) fixes the following issues
Adds feature: Allow modification of default ports for each service