- name: Cleanup tasks tags: cleanup become: true block: - name: Remove temporary directory file: path: "{{ temp_install_dir.path }}" state: absent when: temp_install_dir.path is defined - name: Remove temporary root directory file: path: "{{ temp_install_dir_root.path }}" state: absent when: temp_install_dir_root.path is defined