mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 18:51:06 -03:30
Get clustered dev env working
This commit is contained in:
committed by
Chris Meyers
parent
6f1f64118b
commit
69edef430c
5
Makefile
5
Makefile
@@ -534,15 +534,16 @@ awx/projects:
|
|||||||
@mkdir -p $@
|
@mkdir -p $@
|
||||||
|
|
||||||
COMPOSE_UP_OPTS ?=
|
COMPOSE_UP_OPTS ?=
|
||||||
|
CLUSER_NODE_COUNT ?= 1
|
||||||
|
|
||||||
docker-compose-sources:
|
docker-compose-sources:
|
||||||
ansible-playbook -i tools/docker-compose/inventory tools/docker-compose/ansible/sources.yml \
|
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=$(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)
|
-e cluster_node_count=$(CLUSER_NODE_COUNT)
|
||||||
|
|
||||||
docker-compose: docker-auth awx/projects docker-compose-sources
|
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
|
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"
|
echo -e "\033[0;31mTo generate a CyberArk Conjur API key: docker exec -it tools_conjur_1 conjurctl account create quick-start\033[0m"
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- "database.py"
|
- "database.py"
|
||||||
- "websocket_secret.py"
|
- "websocket_secret.py"
|
||||||
|
- "haproxy.cfg"
|
||||||
|
|
||||||
- name: Delete old local_settings.py
|
- name: Delete old local_settings.py
|
||||||
file:
|
file:
|
||||||
|
|||||||
@@ -44,6 +44,28 @@ services:
|
|||||||
- "redis_socket_{{ container_postfix }}:/var/run/redis/:rw"
|
- "redis_socket_{{ container_postfix }}:/var/run/redis/:rw"
|
||||||
privileged: true
|
privileged: true
|
||||||
tty: 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 }}:
|
redis_{{ container_postfix }}:
|
||||||
image: redis:latest
|
image: redis:latest
|
||||||
container_name: tools_redis_{{ container_postfix }}
|
container_name: tools_redis_{{ container_postfix }}
|
||||||
@@ -69,22 +91,6 @@ services:
|
|||||||
POSTGRES_PASSWORD: {{ pg_password }}
|
POSTGRES_PASSWORD: {{ pg_password }}
|
||||||
volumes:
|
volumes:
|
||||||
- "awx_db:/var/lib/postgresql/data"
|
- "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:
|
volumes:
|
||||||
awx_db:
|
awx_db:
|
||||||
receptor:
|
receptor:
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
global
|
global
|
||||||
debug
|
|
||||||
stats socket /tmp/admin.sock
|
stats socket /tmp/admin.sock
|
||||||
stats timeout 30s
|
stats timeout 30s
|
||||||
|
|
||||||
@@ -30,16 +29,18 @@ backend nodes
|
|||||||
http-request set-header X-Forwarded-Port %[dst_port]
|
http-request set-header X-Forwarded-Port %[dst_port]
|
||||||
http-request add-header X-Forwarded-Proto https if { ssl_fc }
|
http-request add-header X-Forwarded-Proto https if { ssl_fc }
|
||||||
option httpchk HEAD / HTTP/1.1\r\nHost:localhost
|
option httpchk HEAD / HTTP/1.1\r\nHost:localhost
|
||||||
server awx-1 awx-1:8013 check
|
{% for i in range(cluster_node_count|int) %}
|
||||||
server awx-2 awx-2:8013 check
|
{% set container_postfix = loop.index %}
|
||||||
server awx-3 awx-3:8013 check
|
server tools_awx_{{ container_postfix }} tools_awx_{{ container_postfix }}:8013 check
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
backend nodes_ssl
|
backend nodes_ssl
|
||||||
mode tcp
|
mode tcp
|
||||||
balance roundrobin
|
balance roundrobin
|
||||||
server awx-1 awx-1:8043
|
{% for i in range(cluster_node_count|int) %}
|
||||||
server awx-2 awx-2:8043
|
{% set container_postfix = loop.index %}
|
||||||
server awx-3 awx-3:8043
|
server tools_awx_{{ container_postfix }} tools_awx_{{ container_postfix }}:8043 check
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
listen stats
|
listen stats
|
||||||
bind *:1936
|
bind *:1936
|
||||||
Reference in New Issue
Block a user