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