---
- name: create folder
  tags: fail2ban
  become: true
  file:
    path: /etc/fail2ban
    state: directory

- name: ssh jail
  tags: fail2ban
  become: true
  template:
    src: jail.local
    dest: /etc/fail2ban/jail.local
  notify: restart fail2ban

- name: install fail2ban
  tags: fail2ban
  become: true
  apt:
    name: fail2ban
    state: present
  notify: restart fail2ban
