check new version
This commit is contained in:
23
roles/01-server_hardening/tasks/05-configure-fail2ban.yml
Normal file
23
roles/01-server_hardening/tasks/05-configure-fail2ban.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Install fail2ban
|
||||
ansible.builtin.apt:
|
||||
name: fail2ban
|
||||
state: present
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Configure fail2ban jail
|
||||
ansible.builtin.template:
|
||||
src: fail2ban.jail.local.j2
|
||||
dest: "{{ fail2ban_config_dir }}/jail.local"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
backup: yes
|
||||
notify: restart fail2ban service
|
||||
|
||||
- name: Ensure fail2ban is started and enabled
|
||||
ansible.builtin.systemd:
|
||||
name: fail2ban
|
||||
state: started
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
Reference in New Issue
Block a user