2022-11-18 18:33:37 +01:00
|
|
|
---
|
|
|
|
# tasks file for fail2ban-basic
|
2023-01-13 18:01:41 +01:00
|
|
|
|
|
|
|
- ansible.builtin.debug:
|
|
|
|
msg: "ENABLED = {{ fail2ban_enabled }}; fail2ban-basic role"
|
|
|
|
|
|
|
|
- when:
|
|
|
|
- 'fail2ban_enabled is true'
|
2023-01-11 17:44:16 +01:00
|
|
|
- "'global.update_only' not in ansible_run_tags"
|
2022-11-18 18:33:37 +01:00
|
|
|
block:
|
|
|
|
- name: Install Fail2ban
|
|
|
|
ansible.builtin.package:
|
|
|
|
name: "{{ fail2ban_package_name_by_os_family[ansible_os_family] }}"
|
|
|
|
|
|
|
|
- name: Enable Fail2ban service
|
|
|
|
when: "is_docker is not true"
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: fail2ban
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
masked: no
|