--- - name: Remove snapd from Ubuntu ansible.builtin.apt: name: snapd state: absent purge: yes when: ansible_distribution == "Ubuntu" - name: Remove snapd-related directories ansible.builtin.file: path: "{{ item }}" state: absent with_items: - /snap - /var/snap - /var/lib/snapd - "/home/{{ ansible_user }}/snap" when: ansible_distribution == "Ubuntu" ...