Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ security_autoupdate_mail_to: ""
security_autoupdate_mail_on_error: true

security_fail2ban_enabled: true
security_fail2ban_custom_configuration_template: "jail.local.j2"
security_fail2ban_custom_jail_template: "jail.local.j2"
security_fail2ban_custom_configuration_template: "fail2ban.local.j2"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, the variable name security_fail2ban_custom_configuration_template seems to be good for fail2ban.local. Nevertheless, for backward compatibility it would be better to keep it for the jail.local and create a new variable for the fail2ban.local config.

Proposal:

security_fail2ban_custom_fail2ban_local_template: "fail2ban.local.j2"
security_fail2ban_custom_configuration_template: "jail.local.j2"

In this case only the line

src: fail2ban.local.j2

needs to be changed to

src: "{{ security_fail2ban_custom_fail2ban_local_template }}"

in file tasks/fail2ban.yml

3 changes: 2 additions & 1 deletion tasks/fail2ban.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

- name: Copy jail custom configuration file into place.
template:
src: "{{ security_fail2ban_custom_configuration_template }}"
src: "{{ security_fail2ban_custom_jail_template }}"
dest: /etc/fail2ban/jail.local
owner: root
group: root
Expand All @@ -25,6 +25,7 @@
- name: Copy fail2ban custom configuration file into place.
template:
src: fail2ban.local.j2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line src: fail2ban.local.j2 needs to removed. Then it should work.

src: "{{ security_fail2ban_custom_configuration_template }}"
dest: /etc/fail2ban/fail2ban.local
owner: root
group: root
Expand Down
Loading