Fix Fail2ban installation process

This commit is contained in:
Tanguy Herbron 2022-06-11 02:32:23 +02:00
parent 09376d3cd1
commit 886232e1aa
2 changed files with 9 additions and 11 deletions

View File

@ -5,9 +5,3 @@
name: sshd
state: restarted
listen: "restart sshd"
- name: Restart fail2ban service
ansible.builtin.service:
name: fail2ban
state: restarted
listen: "restart fail2ban"

View File

@ -1,15 +1,19 @@
---
- name: Install fail2ban
ansible.builtin.package:
name: fail2ban
state: present
- name: Ensures fail2ban dir exists
file:
path: /etc/fail2ban
state: directory
- name: Configure fail2ban
copy:
src: ../templates/fail2ban.conf
dest: /etc/fail2ban/fail2ban.conf
backup: yes
notify: restart fail2ban
- name: Install fail2ban
ansible.builtin.package:
name: fail2ban
state: present
- name: Disable password login
lineinfile: