Skip to content

Commit

Permalink
Update awx-manage commands for mesh ingress
Browse files Browse the repository at this point in the history
and fix linting

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

Set correct protocol for external mesh ingress address

and fix linting error
  • Loading branch information
TheRealHaoLiu committed Jan 18, 2024
1 parent 4d6b945 commit 8c07565
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions roles/mesh_ingress/tasks/creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand All @@ -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

0 comments on commit 8c07565

Please sign in to comment.