Install Fail2ban IP allow list
This commit is contained in:
parent
8362230eb4
commit
9eefad0e87
@ -34,6 +34,13 @@
|
||||
dest: /etc/fail2ban/jail.d/sshd.conf
|
||||
notify: restart_fail2ban
|
||||
|
||||
- name: Install Fail2ban IP allow list
|
||||
template:
|
||||
src: fail2ban-allowlist.conf.j2
|
||||
dest: /etc/fail2ban/jail.d/allowlist.conf
|
||||
when: fail2ban_ignoreip is defined
|
||||
notify: restart_fail2ban
|
||||
|
||||
- name: Enable firewall
|
||||
ufw:
|
||||
state: enabled
|
||||
|
2
roles/base/templates/fail2ban-allowlist.conf.j2
Normal file
2
roles/base/templates/fail2ban-allowlist.conf.j2
Normal file
@ -0,0 +1,2 @@
|
||||
[DEFAULT]
|
||||
ignoreip = {% for host in fail2ban_ignoreip %}{{ host }}{% if not loop.last %} {% endif %}{% endfor %}
|
Loading…
Reference in New Issue
Block a user