forked from evolix/ansible-roles
44 lines
788 B
YAML
44 lines
788 B
YAML
---
|
|
# 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"
|
|
notify: restart fail2ban
|
|
force: no
|
|
tags:
|
|
- fail2ban
|
|
|
|
- name: package is installed
|
|
apt:
|
|
name: fail2ban
|
|
state: present
|
|
tags:
|
|
- fail2ban
|
|
- packages
|
|
|
|
- name: custom filters are installed
|
|
copy:
|
|
src: "{{ item }}"
|
|
dest: /etc/fail2ban/filter.d/
|
|
mode: "0644"
|
|
with_items:
|
|
- dovecot-evolix.conf
|
|
- sasl-evolix.conf
|
|
notify: restart fail2ban
|
|
tags:
|
|
- fail2ban
|