--- - name: check whether {{apk}}.apk.bak exists shell: cd {{root_dir}} && [ -f {{apk}}.apk.bak ] ignore_errors: true register: result - name: revert {{apk}}.apk.bak when: result is succeeded shell: cd {{root_dir}} && rm -f {{apk}}.apk && mv {{apk}}.apk.bak {{apk}}.apk