mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
Added labels to AWX kind resource
This commit is contained in:
@@ -7,6 +7,22 @@
|
||||
ansible_python_interpreter: '{{ ansible_playbook_python }}'
|
||||
|
||||
tasks:
|
||||
- name: Get AWX Kind data
|
||||
k8s_info:
|
||||
api_version: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
namespace: example-awx
|
||||
label_selectors:
|
||||
- "app.kubernetes.io/name=example-awx"
|
||||
- "app.kubernetes.io/part-of=example-awx"
|
||||
- "app.kubernetes.io/managed-by=awx-operator"
|
||||
- "app.kubernetes.io/component=awx"
|
||||
register: awx_kind
|
||||
|
||||
- name: Verify there is one AWX kind
|
||||
assert:
|
||||
that: '{{ (awx_kind.resources | length) == 1 }}'
|
||||
|
||||
- name: Get AWX Pod data
|
||||
k8s_info:
|
||||
kind: Pod
|
||||
|
||||
@@ -1,4 +1,21 @@
|
||||
---
|
||||
- name: Patching labels to AWX kind
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
name: '{{ meta.name }}'
|
||||
namespace: '{{ meta.namespace }}'
|
||||
metadata:
|
||||
name: '{{ meta.name }}'
|
||||
namespace: '{{ meta.namespace }}'
|
||||
labels:
|
||||
app.kubernetes.io/name: '{{ meta.name }}'
|
||||
app.kubernetes.io/part-of: '{{ meta.name }}'
|
||||
app.kubernetes.io/managed-by: awx-operator
|
||||
app.kubernetes.io/component: awx
|
||||
|
||||
- name: Get current version
|
||||
set_fact:
|
||||
tower_image_version: "{{ tower_image.split(':')[1] }}"
|
||||
|
||||
Reference in New Issue
Block a user