mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-06 05:12:47 +00:00
Set ownerRef to null for restore created AWX object to avoid garbage collection
- Set defaults for pg type to satisfy conditional
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
|
||||
- name: Check for default PostgreSQL configuration
|
||||
- name: Get PostgreSQL configuration
|
||||
k8s_info:
|
||||
kind: Secret
|
||||
namespace: '{{ meta.namespace }}'
|
||||
@@ -19,11 +19,11 @@
|
||||
awx_postgres_database: "{{ pg_config['resources'][0]['data']['database'] | b64decode }}"
|
||||
awx_postgres_port: "{{ pg_config['resources'][0]['data']['port'] | b64decode }}"
|
||||
awx_postgres_host: "{{ pg_config['resources'][0]['data']['host'] | b64decode }}"
|
||||
awx_postgres_type: "{{ _postgres_configuration['resources'][0]['data']['type'] | b64decode | default('unmanaged') }}"
|
||||
awx_postgres_type: "{{ pg_config['resources'][0]['data']['type'] | b64decode | default('unmanaged') }}"
|
||||
|
||||
- name: Default label selector to custom resource generated postgres
|
||||
set_fact:
|
||||
postgres_label_selector: "app.kubernetes.io/name={{ meta.name }}-postgres"
|
||||
postgres_label_selector: "app.kubernetes.io/name={{ tower_name }}-postgres"
|
||||
when: postgres_label_selector is not defined
|
||||
|
||||
- name: Get the postgres pod information
|
||||
|
||||
@@ -26,3 +26,13 @@
|
||||
# TODO: Add logic to allow users to provide override values here,
|
||||
# or to specify spec values that were not in the backed up AWX object.
|
||||
# This may involve changing how we back up the spec section of the AWX object
|
||||
|
||||
- name: Remove ownerReferences to prevent garbage collection of new AWX CRO
|
||||
k8s:
|
||||
definition:
|
||||
apiVersion: '{{ api_version }}'
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: '{{ tower_name }}'
|
||||
namespace: '{{ meta.namespace }}'
|
||||
ownerReferences: null
|
||||
|
||||
@@ -26,10 +26,11 @@
|
||||
awx_postgres_database: "{{ pg_config['resources'][0]['data']['database'] | b64decode }}"
|
||||
awx_postgres_port: "{{ pg_config['resources'][0]['data']['port'] | b64decode }}"
|
||||
awx_postgres_host: "{{ pg_config['resources'][0]['data']['host'] | b64decode }}"
|
||||
awx_postgres_type: "{{ pg_config['resources'][0]['data']['type'] | b64decode | default('unmanaged') }}"
|
||||
|
||||
- name: Default label selector to custom resource generated postgres
|
||||
set_fact:
|
||||
postgres_label_selector: "app.kubernetes.io/name={{ meta.name }}-postgres"
|
||||
postgres_label_selector: "app.kubernetes.io/name={{ tower_name }}-postgres"
|
||||
when: postgres_label_selector is not defined
|
||||
|
||||
- name: Get the postgres pod information
|
||||
|
||||
Reference in New Issue
Block a user