--- - name: install fail2ban package apt: name: fail2ban state: present update_cache: yes when: ansible_distribution=='Debian' or ansible_distribution=='Ubuntu' become: yes tags: fail2ban - name: copy fail2ban local config copy: src: "{{ role_path }}/files/jail.local" dest: /etc/fail2ban/jail.local owner: root group: root mode: 0644 become: yes tags: fail2ban