- 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: '0644' notify: restart-fail2ban