Get clustered dev env working

This commit is contained in:
Shane McDonald 2021-03-03 19:41:50 -05:00 committed by Chris Meyers
parent 6f1f64118b
commit 69edef430c
4 changed files with 34 additions and 25 deletions

View File

@ -534,15 +534,16 @@ awx/projects:
@mkdir -p $@
COMPOSE_UP_OPTS ?=
CLUSER_NODE_COUNT ?= 1
docker-compose-sources:
ansible-playbook -i tools/docker-compose/inventory tools/docker-compose/ansible/sources.yml \
-e awx_image=$(DEV_DOCKER_TAG_BASE)/awx_devel \
-e awx_image_tag=$(COMPOSE_TAG)
-e awx_image_tag=$(COMPOSE_TAG) \
-e cluster_node_count=$(CLUSER_NODE_COUNT)
docker-compose: docker-auth awx/projects docker-compose-sources
docker-compose -f tools/docker-compose/_sources/docker-compose.yml $(COMPOSE_UP_OPTS) up --no-recreate awx_1
docker-compose -f tools/docker-compose/_sources/docker-compose.yml $(COMPOSE_UP_OPTS) up
docker-compose-credential-plugins: docker-auth awx/projects docker-compose-sources
echo -e "\033[0;31mTo generate a CyberArk Conjur API key: docker exec -it tools_conjur_1 conjurctl account create quick-start\033[0m"

View File

@ -44,6 +44,7 @@
with_items:
- "database.py"
- "websocket_secret.py"
- "haproxy.cfg"
- name: Delete old local_settings.py
file:

View File

@ -44,6 +44,28 @@ services:
- "redis_socket_{{ container_postfix }}:/var/run/redis/:rw"
privileged: true
tty: true
ports:
- "{{ awx_sdb_port_start }}:{{ awx_sdb_port_end }}" # sdb-listen
{% if cluster_node_count|int == 1 %}
- "8080:8080" # unused but mapped for debugging
- "8888:8888" # jupyter notebook
- "8013:8013" # http
- "8043:8043" # https
{% else %}
haproxy:
image: haproxy
volumes:
- "./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg"
depends_on:
{% for i in range(cluster_node_count|int) -%}
{% set container_postfix = loop.index %}
- "awx_{{ container_postfix }}"
{% endfor %}
ports:
- "8013:8013"
- "8043:8043"
- "1936:1936"
{% endif %}
redis_{{ container_postfix }}:
image: redis:latest
container_name: tools_redis_{{ container_postfix }}
@ -69,22 +91,6 @@ services:
POSTGRES_PASSWORD: {{ pg_password }}
volumes:
- "awx_db:/var/lib/postgresql/data"
{% if cluster_node_count|int > 1 %}
haproxy:
image: haproxy
volumes:
- "../ha.conf:/usr/local/etc/haproxy/haproxy.cfg"
depends_on:
{% for i in range(cluster_node_count|int) -%}
{% set container_postfix = loop.index %}
- "awx_{{ container_postfix }}"
{% endfor %}
ports:
- "8013:8013"
- "8043:8043"
- "1936:1936"
{% endif -%} {# haproxy #}
volumes:
awx_db:
receptor:

View File

@ -1,5 +1,4 @@
global
debug
stats socket /tmp/admin.sock
stats timeout 30s
@ -30,16 +29,18 @@ backend nodes
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
option httpchk HEAD / HTTP/1.1\r\nHost:localhost
server awx-1 awx-1:8013 check
server awx-2 awx-2:8013 check
server awx-3 awx-3:8013 check
{% for i in range(cluster_node_count|int) %}
{% set container_postfix = loop.index %}
server tools_awx_{{ container_postfix }} tools_awx_{{ container_postfix }}:8013 check
{% endfor %}
backend nodes_ssl
mode tcp
balance roundrobin
server awx-1 awx-1:8043
server awx-2 awx-2:8043
server awx-3 awx-3:8043
{% for i in range(cluster_node_count|int) %}
{% set container_postfix = loop.index %}
server tools_awx_{{ container_postfix }} tools_awx_{{ container_postfix }}:8043 check
{% endfor %}
listen stats
bind *:1936