Allow changing the ports of the fail2banned services - #48
Conversation
| $bantime = 432000, | ||
| $email = "fail2ban@${::domain}", | ||
| $jails = ['ssh', 'ssh-ddos'], | ||
| $jail_ports = {}, |
There was a problem hiding this comment.
Please add a datatype to the new parmeter.
|
|
||
| validate_hash($config_file_hash) | ||
| validate_hash($config_file_options_hash) | ||
| validate_hash($jail_ports) |
There was a problem hiding this comment.
the validate_* method isn't needed when a datatype is used.
| [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.
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