2024-10-10 11:21:32 +00:00
|
|
|
- name: Install fail2ban and rsyslog packages
|
2024-09-23 12:30:38 +00:00
|
|
|
apt:
|
2024-10-10 11:21:32 +00:00
|
|
|
name: "{{ fail2ban_base_packages }}"
|
2024-09-23 12:30:38 +00:00
|
|
|
state: present
|
2024-09-24 07:38:05 +00:00
|
|
|
- name: Configure fail2ban service
|
2024-09-23 12:30:38 +00:00
|
|
|
template:
|
2024-09-27 11:26:47 +00:00
|
|
|
src: jail.local
|
2024-09-23 12:30:38 +00:00
|
|
|
dest: /etc/fail2ban/jail.local
|
|
|
|
owner: root
|
|
|
|
group: root
|
2024-10-10 14:12:29 +00:00
|
|
|
mode: u=rw,g=r,o=r
|
2024-10-14 11:53:36 +00:00
|
|
|
notify: restart fail2ban
|
|
|
|
- name: Ensure file for auth sshd custom log exists
|
|
|
|
file:
|
|
|
|
path: /var/log/auth.log
|
|
|
|
state: touch
|
|
|
|
owner: root
|
|
|
|
group: adm
|
|
|
|
mode: u=rw,g=r,o=
|