From 46ccc5874900dd07142e496446866a969e50ed35 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Tue, 27 Jul 2021 11:19:07 -0400 Subject: [PATCH] Make the AWX nodes fully connected in the development environment (#10758) --- .../ansible/roles/sources/tasks/main.yml | 9 ++++++- .../sources/templates/docker-compose.yml.j2 | 2 +- .../sources/templates/receptor-awx.conf.j2} | 12 +++++---- .../sources/templates/receptor-hop.conf.j2 | 2 +- .../awx-1-receptor-standalone.conf | 25 ------------------- 5 files changed, 17 insertions(+), 33 deletions(-) rename tools/docker-compose/{receptor.conf => ansible/roles/sources/templates/receptor-awx.conf.j2} (82%) delete mode 100644 tools/docker-compose/awx-1-receptor-standalone.conf diff --git a/tools/docker-compose/ansible/roles/sources/tasks/main.yml b/tools/docker-compose/ansible/roles/sources/tasks/main.yml index 57bc4ed922..5d0d7170bb 100644 --- a/tools/docker-compose/ansible/roles/sources/tasks/main.yml +++ b/tools/docker-compose/ansible/roles/sources/tasks/main.yml @@ -85,12 +85,19 @@ dest: "{{ sources_dest }}/{{ compose_name }}" mode: '0600' +- name: Render Receptor Config(s) for Control Plane + template: + src: "receptor-awx.conf.j2" + dest: "{{ sources_dest }}/receptor/receptor-awx-{{ item }}.conf" + mode: '0600' + with_sequence: start=1 end={{ control_plane_node_count }} + - name: Render Receptor Hop Config template: src: "receptor-hop.conf.j2" dest: "{{ sources_dest }}/receptor/receptor-hop.conf" mode: '0600' - + - name: Render Receptor Worker Config(s) template: src: "receptor-worker.conf.j2" diff --git a/tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2 b/tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2 index c24e7e85f6..cd30a90792 100644 --- a/tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2 +++ b/tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2 @@ -35,7 +35,7 @@ services: - "../../docker-compose/_sources/websocket_secret.py:/etc/tower/conf.d/websocket_secret.py" - "../../docker-compose/_sources/local_settings.py:/etc/tower/conf.d/local_settings.py" - "../../docker-compose/_sources/SECRET_KEY:/etc/tower/SECRET_KEY" - - "../../docker-compose/receptor.conf:/etc/receptor/receptor.conf" + - "../../docker-compose/_sources/receptor/receptor-awx-{{ loop.index }}.conf:/etc/receptor/receptor.conf" - "../../docker-compose-cluster/certs:/etc/receptor/certs" - "/sys/fs/cgroup:/sys/fs/cgroup" - "~/.kube/config:/var/lib/awx/.kube/config" diff --git a/tools/docker-compose/receptor.conf b/tools/docker-compose/ansible/roles/sources/templates/receptor-awx.conf.j2 similarity index 82% rename from tools/docker-compose/receptor.conf rename to tools/docker-compose/ansible/roles/sources/templates/receptor-awx.conf.j2 index 94f360a14e..e95097e1ef 100644 --- a/tools/docker-compose/receptor.conf +++ b/tools/docker-compose/ansible/roles/sources/templates/receptor-awx.conf.j2 @@ -1,6 +1,6 @@ --- - node: - id: awx_1 + id: awx_{{ item }} - log-level: debug @@ -8,6 +8,12 @@ - tcp-listener: port: 2222 +{% for i in range(item | int + 1, control_plane_node_count | int + 1) %} +- tcp-peer: + address: awx_{{ i }}:2222 + redial: true +{% endfor %} + #- tls-server: # name: mutual-tls # cert: /etc/receptor/certs/awx.crt @@ -38,7 +44,3 @@ allowruntimeauth: true allowruntimepod: true allowruntimeparams: true - -- tcp-listener: - port: 4444 - #tls: mutual-tls diff --git a/tools/docker-compose/ansible/roles/sources/templates/receptor-hop.conf.j2 b/tools/docker-compose/ansible/roles/sources/templates/receptor-hop.conf.j2 index 69fd33c3ca..4f055fa1f3 100644 --- a/tools/docker-compose/ansible/roles/sources/templates/receptor-hop.conf.j2 +++ b/tools/docker-compose/ansible/roles/sources/templates/receptor-hop.conf.j2 @@ -5,7 +5,7 @@ - log-level: info - tcp-peer: - address: awx_1:4444 + address: awx_1:2222 redial: true - tcp-listener: diff --git a/tools/docker-compose/awx-1-receptor-standalone.conf b/tools/docker-compose/awx-1-receptor-standalone.conf deleted file mode 100644 index 4c2912ea88..0000000000 --- a/tools/docker-compose/awx-1-receptor-standalone.conf +++ /dev/null @@ -1,25 +0,0 @@ ---- -- node: - id: execution_node_1 - -- log-level: info - -#- tls-client: -# name: mutual-tls-client -# cert: /etc/receptor/certs/receptor_1.crt -# key: /etc/receptor/certs/receptor_1.key -# rootcas: /etc/receptor/certs/ca.crt - -- tcp-peer: - address: awx_1:4444 - redial: true - #tls: mutual-tls-client - -- work-command: - worktype: ansible-runner - command: ansible-runner - params: worker - allowruntimeparams: true - -- control-service: - service: control