---

- name: remove default debian fail2ban ssh configuration
  become: yes
  file:
    path: /etc/fail2ban/jail.d/defaults-debian.conf
    state: absent
  notify: reload fail2ban

- name: configure fail2ban for ssh
  become: yes
  copy:
    src: templates/jail.d/ssh.local
    dest: /etc/fail2ban/jail.d/ssh.local
    owner: root
    group: root
    mode: u=rw,g=r,o=r
  notify: reload fail2ban
