mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-08 14:22:49 +00:00
preserve newlines in AWX spec
This commit is contained in:
@@ -10,11 +10,8 @@
|
|||||||
|
|
||||||
- name: Set AWX object
|
- name: Set AWX object
|
||||||
set_fact:
|
set_fact:
|
||||||
_awx: "{{ _awx_cro['resources'][0] }}"
|
awx_spec:
|
||||||
|
spec: "{{ this_awx['resources'][0]['spec'] }}"
|
||||||
- name: Set user specified spec
|
|
||||||
set_fact:
|
|
||||||
awx_spec: "{{ _awx['spec'] }}"
|
|
||||||
|
|
||||||
- name: Set names of backed up secrets in the CR spec
|
- name: Set names of backed up secrets in the CR spec
|
||||||
set_fact:
|
set_fact:
|
||||||
@@ -30,4 +27,4 @@
|
|||||||
namespace: "{{ backup_pvc_namespace }}"
|
namespace: "{{ backup_pvc_namespace }}"
|
||||||
pod: "{{ meta.name }}-db-management"
|
pod: "{{ meta.name }}-db-management"
|
||||||
command: >-
|
command: >-
|
||||||
bash -c 'echo "$0" > {{ backup_dir }}/awx_object' {{ awx_spec | quote }}
|
bash -c 'echo "$0" > {{ backup_dir }}/awx_object' {{ awx_spec | to_yaml | quote }}
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Save kind
|
|
||||||
set_fact:
|
|
||||||
_kind: "{{ kind }}"
|
|
||||||
|
|
||||||
- name: Get AWX object definition from pvc
|
- name: Get AWX object definition from pvc
|
||||||
k8s_exec:
|
k8s_exec:
|
||||||
namespace: "{{ backup_pvc_namespace }}"
|
namespace: "{{ backup_pvc_namespace }}"
|
||||||
@@ -25,22 +21,13 @@
|
|||||||
|
|
||||||
- name: Include spec vars to save them as a dict
|
- name: Include spec vars to save them as a dict
|
||||||
include_vars: "{{ tmp_spec.path }}"
|
include_vars: "{{ tmp_spec.path }}"
|
||||||
register: spec
|
|
||||||
|
|
||||||
- name: Use include_vars to read in spec as a dict (because spec doesn't have quotes)
|
|
||||||
set_fact:
|
|
||||||
awx_spec: "{{ spec.ansible_facts }}"
|
|
||||||
|
|
||||||
- name: Restore kind
|
|
||||||
set_fact:
|
|
||||||
kind: "{{ _kind }}"
|
|
||||||
|
|
||||||
- name: Deploy AWX
|
- name: Deploy AWX
|
||||||
k8s:
|
k8s:
|
||||||
state: "{{ state | default('present') }}"
|
state: "{{ state | default('present') }}"
|
||||||
namespace: "{{ meta.namespace }}"
|
namespace: "{{ meta.namespace }}"
|
||||||
apply: yes
|
apply: yes
|
||||||
template: awx_object.yml.j2
|
definition: "{{ lookup('template', 'awx_object.yml.j2') }}"
|
||||||
wait: true
|
wait: true
|
||||||
wait_condition:
|
wait_condition:
|
||||||
type: "Running"
|
type: "Running"
|
||||||
|
|||||||
@@ -4,4 +4,5 @@ kind: AWX
|
|||||||
metadata:
|
metadata:
|
||||||
name: '{{ deployment_name }}'
|
name: '{{ deployment_name }}'
|
||||||
namespace: '{{ meta.namespace }}'
|
namespace: '{{ meta.namespace }}'
|
||||||
spec: {{ awx_spec }}
|
spec:
|
||||||
|
{{ spec | to_yaml | indent(2) }}
|
||||||
|
|||||||
Reference in New Issue
Block a user