connection: local
tasks: - block: - tempfile: state: directory register: tempfile_out - command: /bin/false rescue: - debug: msg="Yikes, something broke, cleaning up tmp dir {{ tempfile_out.path }}" - file: name: "{{ tempfile_out.path }}" state: absent