Update awx-manage commands for mesh ingress

and fix linting

Signed-off-by: Seth Foster <fosterbseth@gmail.com>

Set correct protocol for external mesh ingress address

and fix linting error
This commit is contained in:
Hao Liu
2024-01-08 13:35:00 -05:00
committed by Christian Adams
parent 69474557eb
commit 0ca3f1a7c4

View File

@@ -48,7 +48,7 @@
set_fact:
_custom_control_plane_ee_image: "{{ awx_spec.control_plane_ee_image }}"
when:
- awx_spec.control_plane_ee_image | default([]) | length
- awx_spec.control_plane_ee_image | default([]) | length
- name: Set Control Plane EE image URL
set_fact:
@@ -97,11 +97,11 @@
kind: Pod
namespace: '{{ ansible_operator_meta.namespace }}'
label_selectors:
- "app.kubernetes.io/name={{ deployment_name }}-task"
- "app.kubernetes.io/managed-by={{ deployment_type }}-operator"
- "app.kubernetes.io/component={{ deployment_type }}"
- "app.kubernetes.io/name={{ deployment_name }}-task"
- "app.kubernetes.io/managed-by={{ deployment_type }}-operator"
- "app.kubernetes.io/component={{ deployment_type }}"
field_selectors:
- status.phase=Running
- status.phase=Running
register: awx_task_pod
- name: Set the resource pod as a variable.
@@ -116,26 +116,35 @@
set_fact:
awx_task_pod_name: "{{ awx_task_pod['metadata']['name'] | default('') }}"
# TODO: awx-manage provision_instance does not currently support peer from control nodes
# !!!dependent on API/CLI changes!!!
- name: Add new instance to AWX
kubernetes.core.k8s_exec:
namespace: "{{ ansible_operator_meta.namespace }}"
pod: "{{ awx_task_pod_name }}"
container: "{{ deployment_name }}-task"
command: "awx-manage provision_instance --hostname {{ ansible_operator_meta.name }} --node_type hop"
register: result
command: |
awx-manage provision_instance
--hostname {{ ansible_operator_meta.name }}
--node_type hop
- name: Add internal receptor address
kubernetes.core.k8s_exec:
namespace: "{{ ansible_operator_meta.namespace }}"
pod: "{{ awx_task_pod_name }}"
container: "{{ deployment_name }}-task"
command: "awx-manage add_receptor_address --hostname {{ ansible_operator_meta.name }} --address {{ ansible_operator_meta.name }} --port 27199 --protocol ws --is_internal --peers_from_control_nodes"
command: |
awx-manage add_receptor_address
--instance {{ ansible_operator_meta.name }}
--address {{ ansible_operator_meta.name }}
--port 27199 --protocol ws
--peers_from_control_nodes --is_internal --canonical
- name: Add external receptor address
kubernetes.core.k8s_exec:
namespace: "{{ ansible_operator_meta.namespace }}"
pod: "{{ awx_task_pod_name }}"
container: "{{ deployment_name }}-task"
command: "awx-manage add_receptor_address --hostname {{ ansible_operator_meta.name }} --address {{ external_hostname }} --port 443 --protocol ws"
command: |
awx-manage add_receptor_address
--instance {{ ansible_operator_meta.name }}
--address {{ external_hostname }}
--port 443 --protocol ws