diff --git a/roles/backup-remove-strata/tasks/main.yaml b/roles/backup-remove-strata/tasks/main.yaml new file mode 100644 index 0000000..9f68b47 --- /dev/null +++ b/roles/backup-remove-strata/tasks/main.yaml @@ -0,0 +1,19 @@ +--- + +- 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 + + +- name: Backup old {{ strata }} strata + ansible.builtin.shell: | + brl disable {{ strata }} + brl rename {{ strata }} {{ strata }}.backup + brl hide {{ strata }}.backup diff --git a/roles/fetch-strata/tasks/main.yaml b/roles/fetch-strata/tasks/main.yaml new file mode 100644 index 0000000..e9bcf64 --- /dev/null +++ b/roles/fetch-strata/tasks/main.yaml @@ -0,0 +1,9 @@ + +- name: Backup and remove old {{ strata }} strata + include_role: + name: backup-remove-strata + +- name: Fetch {{ strata }} strata + ansible.builtin.shell: + cmd: brl fetch {{ strata }} + diff --git a/roles/fetch-stratum/tasks/main.yaml b/roles/fetch-stratum/tasks/main.yaml index 3ba153f..599f503 100644 --- a/roles/fetch-stratum/tasks/main.yaml +++ b/roles/fetch-stratum/tasks/main.yaml @@ -1,8 +1,11 @@ -- name: fetch alpine linux - ansible.builtin.shell: - cmd: brl remove -d alpine; brl fetch alpine - -- name: fetch arch linux - ansible.builtin.shell: - cmd: brl remove -d arch; brl fetch arch +- name: Fetch new alpine strata + include_role: + name: fetch-strata + vars: + strata: alpine +- name: Fetch new arch linux + include_role: + name: fetch-strata + vars: + strata: arch