2019-03-16 12:51:32 +01:00
|
|
|
---
|
2019-03-09 21:38:48 +01:00
|
|
|
- name: Install fail2ban filter
|
2021-03-22 21:21:25 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
2019-03-08 13:12:16 +01:00
|
|
|
src: fail2ban/filter.conf.j2
|
|
|
|
dest: /etc/fail2ban/filter.d/gitea.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
2019-03-16 12:51:32 +01:00
|
|
|
mode: 0444
|
2021-03-22 21:21:25 +01:00
|
|
|
notify: systemctl restart fail2ban
|
2021-04-12 12:39:11 +02:00
|
|
|
when: "'fail2ban' in ansible_facts.packages"
|
2019-03-08 13:12:16 +01:00
|
|
|
|
2019-03-09 21:38:48 +01:00
|
|
|
- name: Install fail2ban jail
|
2021-03-22 21:21:25 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
2019-03-08 13:12:16 +01:00
|
|
|
src: fail2ban/jail.conf.j2
|
|
|
|
dest: /etc/fail2ban/jail.d/gitea.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
2019-03-16 12:51:32 +01:00
|
|
|
mode: 0444
|
2021-03-22 21:21:25 +01:00
|
|
|
notify: systemctl restart fail2ban
|
2021-04-12 12:39:11 +02:00
|
|
|
when: "'fail2ban' in ansible_facts.packages"
|
2021-04-12 16:56:48 +02:00
|
|
|
|
|
|
|
- name: warn if fail2ban is not installed
|
|
|
|
ansible.builtin.fail:
|
|
|
|
msg: "the package fail2ban is not installed. no fail2ban filters deployed."
|
|
|
|
when: "'fail2ban' not in ansible_facts.packages"
|
2022-01-16 18:00:52 +01:00
|
|
|
tags: skip_ansible_lint
|
2021-04-12 16:56:48 +02:00
|
|
|
ignore_errors: true
|