kind,api_version: Dynamically retrieve those values

This commit is contained in:
Yanis Guenane
2021-02-25 11:22:53 +01:00
parent b8d12d93fb
commit e589a999a8
5 changed files with 9 additions and 14 deletions

View File

@@ -26,9 +26,6 @@ spec:
deployment_type:
description: Name of the deployment type
type: string
api_version:
description: API version identified
type: string
tower_task_privileged:
description: If a privileged security context should be enabled
type: boolean

View File

@@ -167,9 +167,6 @@ spec:
deployment_type:
description: Name of the deployment type
type: string
api_version:
description: API version identified
type: string
tower_task_privileged:
description: If a privileged security context should be enabled
type: boolean

View File

@@ -26,9 +26,6 @@ spec:
deployment_type:
description: Name of the deployment type
type: string
api_version:
description: API version identified
type: string
tower_task_privileged:
description: If a privileged security context should be enabled
type: boolean

View File

@@ -1,6 +1,5 @@
---
deployment_type: awx
api_version: '{{ deployment_type }}.ansible.com/v1beta1'
tower_task_privileged: false
tower_ingress_type: none

View File

@@ -1,8 +1,13 @@
---
- name: Set apiVersion and kind variables
set_fact:
api_version: '{{ hostvars["localhost"]["inventory_file"].split("/")[4:6] | join("/") }}'
kind: '{{ hostvars["localhost"]["inventory_file"].split("/")[6] }}'
- name: Update admin password status
operator_sdk.util.k8s_status:
api_version: '{{ api_version }}'
kind: "{{ deployment_type | upper }}"
kind: "{{ kind }}"
name: "{{ meta.name }}"
namespace: "{{ meta.namespace }}"
status:
@@ -11,7 +16,7 @@
- name: Update admin user status
operator_sdk.util.k8s_status:
api_version: '{{ api_version }}'
kind: "{{ deployment_type | upper }}"
kind: "{{ kind }}"
name: "{{ meta.name }}"
namespace: "{{ meta.namespace }}"
status:
@@ -30,7 +35,7 @@
- name: Update version status
operator_sdk.util.k8s_status:
api_version: '{{ api_version }}'
kind: "{{ deployment_type | upper }}"
kind: "{{ kind }}"
name: "{{ meta.name }}"
namespace: "{{ meta.namespace }}"
status:
@@ -47,7 +52,7 @@
- name: Update URL status
operator_sdk.util.k8s_status:
api_version: '{{ api_version }}'
kind: "{{ deployment_type | upper }}"
kind: "{{ kind }}"
name: "{{ meta.name }}"
namespace: "{{ meta.namespace }}"
status: