1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-28 10:55:30 +03:00

Register the hop & execution nodes and all node links

This commit is contained in:
Jeff Bradberry 2022-01-07 16:43:59 -05:00
parent 386aa898ec
commit 37907ad348
2 changed files with 19 additions and 0 deletions

View File

@ -19,6 +19,8 @@ services:
AWX_GROUP_QUEUES: tower AWX_GROUP_QUEUES: tower
MAIN_NODE_TYPE: "${MAIN_NODE_TYPE:-hybrid}" MAIN_NODE_TYPE: "${MAIN_NODE_TYPE:-hybrid}"
RECEPTORCTL_SOCKET: {{ receptor_socket_file }} RECEPTORCTL_SOCKET: {{ receptor_socket_file }}
CONTROL_PLANE_NODE_COUNT: {{ control_plane_node_count|int }}
EXECUTION_NODE_COUNT: {{ execution_node_count|int }}
{% if loop.index == 1 %} {% if loop.index == 1 %}
RUN_MIGRATIONS: 1 RUN_MIGRATIONS: 1
{% endif %} {% endif %}

View File

@ -36,6 +36,23 @@ awx-manage provision_instance --hostname="$(hostname)" --node_type="$MAIN_NODE_T
awx-manage register_queue --queuename=controlplane --instance_percent=100 awx-manage register_queue --queuename=controlplane --instance_percent=100
awx-manage register_queue --queuename=default --instance_percent=100 awx-manage register_queue --queuename=default --instance_percent=100
if [[ -n "$RUN_MIGRATIONS" ]]; then
for (( i=1; i<$CONTROL_PLANE_NODE_COUNT; i++ )); do
for (( j=i + 1; j<=$CONTROL_PLANE_NODE_COUNT; j++ )); do
awx-manage register_peers "awx_$i" --peers "awx_$j"
done
done
if [[ $EXECUTION_NODE_COUNT > 0 ]]; then
awx-manage provision_instance --hostname="receptor-hop" --node_type="hop"
awx-manage register_peers "receptor-hop" --peers "awx_1"
for (( e=1; e<=$EXECUTION_NODE_COUNT; e++ )); do
awx-manage provision_instance --hostname="receptor-$e" --node_type="execution"
awx-manage register_peers "receptor-$e" --peers "receptor-hop"
done
fi
fi
# Create resource entries when using Minikube # Create resource entries when using Minikube
if [[ -n "$MINIKUBE_CONTAINER_GROUP" ]]; then if [[ -n "$MINIKUBE_CONTAINER_GROUP" ]]; then
awx-manage shell < /awx_devel/tools/docker-compose-minikube/_sources/bootstrap_minikube.py awx-manage shell < /awx_devel/tools/docker-compose-minikube/_sources/bootstrap_minikube.py