27 lines
643 B
YAML
27 lines
643 B
YAML
---
|
|
|
|
- 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
|
|
register: strata_backup
|
|
|
|
|
|
- name: Delete previous backup {{ strata }} strata
|
|
ansible.builtin.shell:
|
|
cmd: brl remove {{ strata }}.backup
|
|
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
|