Update CSV with richer fields

This commit is contained in:
Yanis Guenane
2021-02-02 13:17:31 +01:00
parent 821198c05e
commit 452bb128c6
5 changed files with 187 additions and 9 deletions

View File

@@ -40,12 +40,3 @@
- name: Store admin password
set_fact:
tower_admin_password: "{{ admin_password_secret['resources'][0]['data']['password'] | b64decode }}"
- name: Set admin password secret status
operator_sdk.util.k8s_status:
api_version: awx.ansible.com/v1beta1
kind: "{{ deployment_type | upper }}"
name: "{{ meta.name }}"
namespace: "{{ meta.namespace }}"
status:
towerAdminPasswordSecret: "{{ admin_password_secret['resources'][0]['metadata']['name'] }}"

View File

@@ -68,3 +68,6 @@
when: (k8s_defs_result is changed) or (database_check is defined and database_check.return_code != 0)
- include_tasks: initialize.yml
- name: Update status variables
include_tasks: update_status.yml

View File

@@ -0,0 +1,56 @@
---
- name: Update admin password status
operator_sdk.util.k8s_status:
api_version: awx.ansible.com/v1beta1
kind: "{{ deployment_type | upper }}"
name: "{{ meta.name }}"
namespace: "{{ meta.namespace }}"
status:
towerAdminPasswordSecret: "{{ admin_password_secret['resources'][0]['metadata']['name'] }}"
- name: Update admin user status
operator_sdk.util.k8s_status:
api_version: awx.ansible.com/v1beta1
kind: "{{ deployment_type | upper }}"
name: "{{ meta.name }}"
namespace: "{{ meta.namespace }}"
status:
towerAdminUser: "{{ tower_admin_user }}"
- name: Retrieve instance version
community.kubernetes.k8s_exec:
namespace: "{{ meta.namespace }}"
pod: "{{ tower_pod_name }}"
container: "{{ meta.name }}-task"
command: >-
bash -c "awx-manage --version"
register: instance_version
changed_when: false
- name: Update version status
operator_sdk.util.k8s_status:
api_version: awx.ansible.com/v1beta1
kind: "{{ deployment_type | upper }}"
name: "{{ meta.name }}"
namespace: "{{ meta.namespace }}"
status:
towerVersion: "{{ instance_version.stdout }}"
- block:
- name: Retrieve route URL
community.kubernetes.k8s_info:
kind: Route
namespace: '{{ meta.namespace }}'
name: '{{ meta.name }}'
register: route_url
- name: Update URL status
operator_sdk.util.k8s_status:
api_version: awx.ansible.com/v1beta1
kind: "{{ deployment_type | upper }}"
name: "{{ meta.name }}"
namespace: "{{ meta.namespace }}"
status:
towerURL: "https://{{ route_url['resources'][0]['status']['ingress'][0]['host'] }}"
when: tower_ingress_type | lower == 'route'