Fix error on stratum no existing
This commit is contained in:
parent
f4bb962ba8
commit
9e318ad677
@ -1,5 +1,11 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
- name: Find if {{strata}} strata exists
|
||||||
|
stat:
|
||||||
|
path: /bedrock/strata/{{ strata }}
|
||||||
|
register: strata_folder
|
||||||
|
|
||||||
|
|
||||||
- name: Find if backup {{strata}} strata exists
|
- name: Find if backup {{strata}} strata exists
|
||||||
stat:
|
stat:
|
||||||
path: /bedrock/strata/{{ strata }}.backup
|
path: /bedrock/strata/{{ strata }}.backup
|
||||||
@ -9,11 +15,12 @@
|
|||||||
- name: Delete previous backup {{ strata }} strata
|
- name: Delete previous backup {{ strata }} strata
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: brl remove {{ strata }}.backup
|
cmd: brl remove {{ strata }}.backup
|
||||||
when: strata_backup.stat.exists
|
when: strata_backup.stat.exists and strata_folder.stat.exists
|
||||||
|
|
||||||
|
|
||||||
- name: Backup old {{ strata }} strata
|
- name: Backup old {{ strata }} strata
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
brl disable {{ strata }}
|
brl disable {{ strata }}
|
||||||
brl rename {{ strata }} {{ strata }}.backup
|
brl rename {{ strata }} {{ strata }}.backup
|
||||||
brl hide {{ strata }}.backup
|
brl hide {{ strata }}.backup
|
||||||
|
when: strata_folder.stat.exists
|
||||||
|
Loading…
x
Reference in New Issue
Block a user