Fix error on stratum no existing

This commit is contained in:
CactiChameleon9 2022-07-30 15:24:17 +01:00
parent f4bb962ba8
commit 9e318ad677

View File

@ -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
stat:
path: /bedrock/strata/{{ strata }}.backup
@ -9,11 +15,12 @@
- name: Delete previous backup {{ strata }} strata
ansible.builtin.shell:
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
ansible.builtin.shell: |
brl disable {{ strata }}
brl rename {{ strata }} {{ strata }}.backup
brl hide {{ strata }}.backup
when: strata_folder.stat.exists