mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-08 06:12:54 +00:00
Add secret names as statuses on the AWX object
- set migrate data status even if custom name for old postgres config is not used - Allow users to change pg name, pw & db name for a managed postgres - set default value for postgres-configuration type as unmanaged if secret is created - Make pg port configurable for managed deployments
This commit is contained in:
@@ -100,7 +100,6 @@
|
||||
definition: "{{ lookup('template', 'tower_postgres.yaml.j2') }}"
|
||||
when: pg_config['resources'][0]['data']['type'] | default('') | b64decode == 'managed'
|
||||
|
||||
|
||||
- name: Store Database Configuration
|
||||
set_fact:
|
||||
awx_postgres_user: "{{ pg_config['resources'][0]['data']['username'] | b64decode }}"
|
||||
@@ -110,12 +109,6 @@
|
||||
awx_postgres_host: "{{ pg_config['resources'][0]['data']['host'] | b64decode }}"
|
||||
awx_postgres_sslmode: "{{ pg_config['resources'][0]['data']['sslmode'] | default('prefer'|b64encode) | b64decode }}"
|
||||
|
||||
- name: Create Database if no database is specified
|
||||
k8s:
|
||||
apply: true
|
||||
definition: "{{ lookup('template', 'tower_postgres.yaml.j2') }}"
|
||||
when:
|
||||
- pg_config['resources'][0]['data']['type'] | default('') | b64decode == 'managed'
|
||||
|
||||
- name: Set apiVersion and kind variables
|
||||
set_fact:
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
---
|
||||
|
||||
- name: Set actual old postgres configuration secret name
|
||||
set_fact:
|
||||
old_postgres_configuration_name: "{{ old_pg_config['resources'][0]['metadata']['name'] }}"
|
||||
|
||||
- name: Store Database Configuration
|
||||
set_fact:
|
||||
awx_old_postgres_user: "{{ old_pg_config['resources'][0]['data']['username'] | b64decode }}"
|
||||
@@ -60,4 +64,4 @@
|
||||
|
||||
- name: Set flag signifying that this instance has been migrated
|
||||
set_fact:
|
||||
tower_migrated_from_secret: "{{ tower_old_postgres_configuration_secret }}"
|
||||
tower_migrated_from_secret: "{{ old_postgres_configuration_name }}"
|
||||
|
||||
@@ -17,6 +17,33 @@
|
||||
status:
|
||||
towerAdminUser: "{{ tower_admin_user }}"
|
||||
|
||||
- name: Update postgres configuration status
|
||||
operator_sdk.util.k8s_status:
|
||||
api_version: '{{ api_version }}'
|
||||
kind: "{{ kind }}"
|
||||
name: "{{ meta.name }}"
|
||||
namespace: "{{ meta.namespace }}"
|
||||
status:
|
||||
towerPostgresConfigurationSecret: "{{ pg_config['resources'][0]['metadata']['name'] }}"
|
||||
|
||||
- name: Update broadcast websocket status
|
||||
operator_sdk.util.k8s_status:
|
||||
api_version: '{{ api_version }}'
|
||||
kind: "{{ kind }}"
|
||||
name: "{{ meta.name }}"
|
||||
namespace: "{{ meta.namespace }}"
|
||||
status:
|
||||
towerBroadcastWebsocketSecret: "{{ broadcast_websocket_secret['resources'][0]['metadata']['name'] }}"
|
||||
|
||||
- name: Update secret key status
|
||||
operator_sdk.util.k8s_status:
|
||||
api_version: '{{ api_version }}'
|
||||
kind: "{{ kind }}"
|
||||
name: "{{ meta.name }}"
|
||||
namespace: "{{ meta.namespace }}"
|
||||
status:
|
||||
towerSecretKeySecret: "{{ secret_key_secret_name }}"
|
||||
|
||||
- name: Retrieve instance version
|
||||
k8s_exec:
|
||||
namespace: "{{ meta.namespace }}"
|
||||
|
||||
Reference in New Issue
Block a user