--- - name: Update APT package cache apt: update_cache: true upgrade: dist - name: Install debian packages apt: name: "{{ item }}" state: present with_items: - "unattended-upgrades" - "joe" - "fail2ban" - name: configure "fail2ban" template: src: jail.local dest: /etc/fail2ban/jail.local - name: Restart fail2ban ansible.builtin.systemd: name: fail2ban.service state: restarted enabled: true