diff --git a/roles/debian-base/handlers/main.yml b/roles/debian-base/handlers/main.yml index 6d3fab4..e2ee81e 100644 --- a/roles/debian-base/handlers/main.yml +++ b/roles/debian-base/handlers/main.yml @@ -6,7 +6,7 @@ systemd: name: ssh state: restarted -- name: restart-fail2ban +- name: restart fail2ban systemd: name: fail2ban state: restarted diff --git a/roles/debian-base/tasks/fail2ban.yml b/roles/debian-base/tasks/fail2ban.yml index a3ed3f1..33a8d67 100644 --- a/roles/debian-base/tasks/fail2ban.yml +++ b/roles/debian-base/tasks/fail2ban.yml @@ -9,4 +9,11 @@ owner: root group: root mode: u=rw,g=r,o=r - notify: restart-fail2ban + 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= diff --git a/roles/debian-base/templates/jail.local b/roles/debian-base/templates/jail.local index 9c0cd5b..69847a7 100644 --- a/roles/debian-base/templates/jail.local +++ b/roles/debian-base/templates/jail.local @@ -18,4 +18,4 @@ enabled = true port = 0:65535 filter = sshd logpath = {{ fail2ban.logpath }} -action = %(action_mwl)s \ No newline at end of file +action = %(action_mwl)s