2016-11-07 14:00:57 +01:00
|
|
|
---
|
2017-07-19 11:39:38 +02:00
|
|
|
# We have to copy the local jail before installing the package
|
|
|
|
# or we risk being jailed by fail2ban
|
|
|
|
|
|
|
|
- name: Prepare /etc/fail2ban
|
|
|
|
file:
|
|
|
|
path: /etc/fail2ban
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0755"
|
|
|
|
tags:
|
|
|
|
- fail2ban
|
|
|
|
|
|
|
|
- name: local jail is installed
|
|
|
|
template:
|
|
|
|
src: jail.local.j2
|
|
|
|
dest: /etc/fail2ban/jail.local
|
|
|
|
mode: "0644"
|
2017-07-19 11:55:04 +02:00
|
|
|
force: no
|
2017-07-19 12:06:19 +02:00
|
|
|
notify: restart fail2ban
|
2017-07-19 11:39:38 +02:00
|
|
|
tags:
|
|
|
|
- fail2ban
|
|
|
|
|
2016-11-07 14:00:57 +01:00
|
|
|
- name: custom filters are installed
|
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: /etc/fail2ban/filter.d/
|
2017-03-23 16:59:43 +01:00
|
|
|
mode: "0644"
|
2016-11-07 14:00:57 +01:00
|
|
|
with_items:
|
|
|
|
- dovecot-evolix.conf
|
|
|
|
- sasl-evolix.conf
|
2017-10-18 15:44:20 +02:00
|
|
|
- wordpress-soft.conf
|
|
|
|
- wordpress-hard.conf
|
2017-10-25 12:12:18 +02:00
|
|
|
- roundcube.conf
|
2016-11-07 14:00:57 +01:00
|
|
|
notify: restart fail2ban
|
2017-07-05 12:00:29 +02:00
|
|
|
tags:
|
|
|
|
- fail2ban
|
2017-10-25 12:11:46 +02:00
|
|
|
|
|
|
|
- name: package is installed
|
|
|
|
apt:
|
|
|
|
name: fail2ban
|
|
|
|
state: present
|
|
|
|
tags:
|
|
|
|
- fail2ban
|
|
|
|
- packages
|
|
|
|
|