1
1
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gitea.git synced 2024-08-16 11:39:50 +02:00
ansible_role_gitea/tasks/fail2ban.yml

30 lines
829 B
YAML
Raw Normal View History

---
2019-03-09 21:38:48 +01:00
- name: Install fail2ban filter
become: true
ansible.builtin.template:
src: fail2ban/filter.conf.j2
dest: /etc/fail2ban/filter.d/gitea.conf
owner: root
group: root
mode: 0444
2022-09-29 23:09:19 +02:00
notify: "Systemctl restart fail2ban"
2021-04-12 12:39:11 +02:00
when: "'fail2ban' in ansible_facts.packages"
2019-03-09 21:38:48 +01:00
- name: Install fail2ban jail
become: true
ansible.builtin.template:
src: fail2ban/jail.conf.j2
dest: /etc/fail2ban/jail.d/gitea.conf
owner: root
group: root
mode: 0444
2022-09-29 23:09:19 +02:00
notify: "Systemctl restart fail2ban"
2021-04-12 12:39:11 +02:00
when: "'fail2ban' in ansible_facts.packages"
2022-09-29 23:09:19 +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"
ignore_errors: true
2022-09-29 23:09:19 +02:00
tags: skip_ansible_lint_ignore-errors