ansible/roles/tomcat/tasks/revert_zip.yml
2021-08-28 23:54:41 +08:00

10 lines
329 B
YAML

---
- name: check whether {{app}}_backup.tgz exists
shell: cd {{root_dir}}/webapps/ && [ -f {{app}}_backup.tgz ]
ignore_errors: true
register: result
- name: revert {{app}}_backup.tgz
when: result is succeeded
shell: cd {{root_dir}}/webapps/ && rm -rf {{app}} && tar zxf {{app}}_backup.tgz && rm -f {{app}}_backup.tgz