--- # file: roles/cleanup/tasks/remove_package.yaml - name: Remove Package - Fix Corrupted APT shell: "dpkg --configure -a" when: - ansible_distribution == 'Ubuntu' tags: - remove-package - name: Remove Package - {{ package }} apt: name: "{{ package }}" force: yes purge: yes state: "absent" failed_when: no when: - ansible_distribution == 'Ubuntu' tags: - remove-package