2019-03-16 06:51:32 -05:00
|
|
|
---
|
2019-03-09 14:38:48 -06:00
|
|
|
- name: Install fail2ban filter
|
2021-04-10 12:07:02 -05:00
|
|
|
ansible.builtin.template:
|
2019-03-08 06:12:16 -06:00
|
|
|
src: fail2ban/filter.conf.j2
|
|
|
|
dest: /etc/fail2ban/filter.d/gitea.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
2019-03-16 06:51:32 -05:00
|
|
|
mode: 0444
|
2019-03-08 06:12:16 -06:00
|
|
|
notify: Restart fail2ban
|
2021-04-12 12:06:19 -05:00
|
|
|
when: "'fail2ban' in ansible_facts.packages"
|
2019-03-08 06:12:16 -06:00
|
|
|
|
2019-03-09 14:38:48 -06:00
|
|
|
- name: Install fail2ban jail
|
2021-04-10 12:07:02 -05:00
|
|
|
ansible.builtin.template:
|
2019-03-08 06:12:16 -06:00
|
|
|
src: fail2ban/jail.conf.j2
|
|
|
|
dest: /etc/fail2ban/jail.d/gitea.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
2019-03-16 06:51:32 -05:00
|
|
|
mode: 0444
|
2019-03-08 06:12:16 -06:00
|
|
|
notify: Restart fail2ban
|
2021-04-12 12:06:19 -05:00
|
|
|
when: "'fail2ban' in ansible_facts.packages"
|
|
|
|
|
|
|
|
- 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"
|
|
|
|
ignore_errors: true
|