--- - include_tasks: check-restack.yaml - name: run unstack.sh become: true become_user: stack shell: cmd: | sudo chown -R stack.stack /opt/stack/ || exit 66 sudo su -l stack -c " rm -f '{{ stack_succeeded_file }}'; cd '{{ devstack_dir }}' && ./unstack.sh " 2>&1 rc=$? echo "*** FINISHED ***" exit $rc register: run_unstack ignore_errors: true when: force_restack | bool - debug: var=run_unstack.stdout_lines when: run_unstack is failed