mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-07 22:02:53 +00:00
Merge pull request #180 from tchellomello/add_labels_to_awx_kind
Added expected labels to AWX kind
This commit is contained in:
@@ -7,6 +7,22 @@
|
|||||||
ansible_python_interpreter: '{{ ansible_playbook_python }}'
|
ansible_python_interpreter: '{{ ansible_playbook_python }}'
|
||||||
|
|
||||||
tasks:
|
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
|
- name: Get AWX Pod data
|
||||||
k8s_info:
|
k8s_info:
|
||||||
kind: Pod
|
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
|
- name: Get current version
|
||||||
set_fact:
|
set_fact:
|
||||||
tower_image_version: "{{ tower_image.split(':')[1] }}"
|
tower_image_version: "{{ tower_image.split(':')[1] }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user