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

@@ -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

@@ -0,0 +1,49 @@
global
stats socket /tmp/admin.sock
stats timeout 30s
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
frontend localnodes
bind *:8013
mode http
default_backend nodes
frontend localnodes_ssl
bind *:8043
mode tcp
default_backend nodes_ssl
backend nodes
mode http
balance roundrobin
option forwardfor
option http-pretend-keepalive
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
{% 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
{% 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
stats enable
stats uri /