Files
awx-operator/roles/backup/tasks/awx-cro.yml
2021-04-30 10:49:31 -04:00

29 lines
658 B
YAML

---
- name: Get AWX custom resource object
k8s_info:
version: v1beta1
kind: AWX
namespace: '{{ meta.namespace }}'
name: '{{ deployment_name }}'
register: _awx_cro
- name: Set AWX object
set_fact:
_awx: "{{ _awx_cro['resources'][0] }}"
- name: Set user specified spec
set_fact:
awx_spec: "{{ _awx['spec'] }}"
- name: Template secrets into yaml
set_fact:
awx_definition_file: "{{ awx_spec }}"
- name: Write awx object to pvc
k8s_exec:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ meta.name }}-db-management"
command: >-
bash -c "echo '{{ awx_definition_file }}' > {{ backup_dir }}/awx_object"