- hosts: localhost tasks: - name: Purge package apt: name: "{{ name }}" state: absent purge: yes