|
|
|
@@ -54,10 +54,6 @@ |
|
|
|
validate_certs: yes |
|
|
|
tags: use-survey |
|
|
|
|
|
|
|
- name: Run export.sh if this job template is run by the client |
|
|
|
command: /bin/sh /root/export.sh |
|
|
|
tags: use-survey |
|
|
|
|
|
|
|
- name: Include vars in matrix_vars.yml |
|
|
|
include_vars: |
|
|
|
file: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml' |
|
|
|
@@ -70,8 +66,28 @@ |
|
|
|
mode: '0660' |
|
|
|
tags: use-survey |
|
|
|
|
|
|
|
- name: Perform the borg backup |
|
|
|
command: borgmatic |
|
|
|
- name: Run initial backup of /matrix/ and snapshot the database simultaneously |
|
|
|
command: "{{ item }}" |
|
|
|
with_items: |
|
|
|
- borgmatic -c /root/.config/borgmatic/config_1.yaml |
|
|
|
- /bin/sh /usr/local/bin/awx-export-service.sh 1 0 |
|
|
|
register: _create_instances |
|
|
|
async: 3600 # Maximum runtime in seconds. |
|
|
|
poll: 0 # Fire and continue (never poll) |
|
|
|
when: matrix_awx_backup_enabled|bool |
|
|
|
|
|
|
|
- name: Wait for both of these jobs to finish |
|
|
|
async_status: |
|
|
|
jid: "{{ item.ansible_job_id }}" |
|
|
|
register: _jobs |
|
|
|
until: _jobs.finished |
|
|
|
delay: 5 # Check every 5 seconds. |
|
|
|
retries: 720 # Retry for a full hour. |
|
|
|
with_items: "{{ _create_instances.results }}" |
|
|
|
when: matrix_awx_backup_enabled|bool |
|
|
|
|
|
|
|
- name: Perform borg backup of postgres dump |
|
|
|
command: borgmatic -c /root/.config/borgmatic/config_2.yaml |
|
|
|
when: matrix_awx_backup_enabled|bool |
|
|
|
|
|
|
|
- name: Set boolean value to exit playbook |
|
|
|
|