22 lines
493 B
YAML
22 lines
493 B
YAML
- name: Install fail2ban and rsyslog packages
|
|
apt:
|
|
name: "{{ fail2ban_base_packages }}"
|
|
state: present
|
|
- name: Configure fail2ban service
|
|
template:
|
|
src: jail.local
|
|
dest: /etc/fail2ban/jail.local
|
|
owner: root
|
|
group: root
|
|
mode: u=rw,g=r,o=r
|
|
notify: restart fail2ban
|
|
register: jail
|
|
- 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=
|
|
when: jail.changed
|