Jake Howard 4890c3d3e5
Revert "Remove fail2ban"
This reverts commit 1f0e33acc8f93bcf793bff5a90ee2d0bca780150.
2020-10-16 19:16:42 +01:00

26 lines
552 B
YAML

- name: Install fail2ban
apt:
name: fail2ban
become: true
- name: fail2ban filter
template:
src: files/haproxy-fail2ban-filter.conf
dest: /etc/fail2ban/filter.d/haproxy-basic.conf
become: true
register: fail2ban_filter
- name: fail2ban jail
template:
src: files/haproxy-fail2ban-jail.conf
dest: /etc/fail2ban/jail.d/haproxy.conf
become: true
register: fail2ban_jail
- name: Restart fail2ban
service:
name: haproxy
state: restarted
become: true
when: fail2ban_filter.changed or fail2ban_jail.changed