Only write values for spec section of awx object in backup

This commit is contained in:
Christian M. Adams
2021-04-12 21:00:58 -04:00
parent 8ed0b1fe61
commit fb612c24df
7 changed files with 79 additions and 45 deletions

View File

@@ -12,21 +12,17 @@
set_fact:
_awx: "{{ _awx_cro['resources'][0] }}"
- name: Set apiVersion
set_fact:
awx_api_version: "{{ _awx['apiVersion'] }}"
- name: Set user specified spec
set_fact:
awx_spec: "{{ _awx['spec'] }}"
- name: Template secrets into yaml
set_fact:
awx_definition_file: "{{ lookup('template', 'awx_object.yml.j2')}}"
awx_definition_file: "{{ awx_spec }}"
- name: Write awx object to pvc
k8s_exec:
namespace: "{{ tower_backup_pvc_namespace }}"
pod: "{{ meta.name }}-db-management"
command: >-
bash -c "echo '{{ awx_definition_file }}' > {{ backup_dir }}/awx_object.yml"
bash -c "echo '{{ awx_definition_file }}' > {{ backup_dir }}/awx_object"

View File

@@ -1,3 +0,0 @@
---
awx_api_version: {{ awx_api_version }}
awx_spec: {{ awx_spec }}