--- # The image ships fail2ban and no APT lists; the check step needs fail2ban gone and the lists back, # or the install task cannot even preview the package. - name: Prepare a host without fail2ban hosts: all gather_facts: false tasks: - name: Purge fail2ban ansible.builtin.apt: name: fail2ban state: absent purge: true - name: Refresh the APT cache ansible.builtin.apt: update_cache: true