mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 18:07:36 -02:30
replace rabbitmq with redis
* local awx docker-compose and image build only.
This commit is contained in:
committed by
Ryan Petrello
parent
be58906aed
commit
e94bb44082
@@ -93,10 +93,6 @@ pg_port=5432
|
|||||||
# containerized postgres deployment on OpenShift
|
# containerized postgres deployment on OpenShift
|
||||||
# pg_admin_password=postgrespass
|
# pg_admin_password=postgrespass
|
||||||
|
|
||||||
# RabbitMQ Configuration
|
|
||||||
rabbitmq_password=awxpass
|
|
||||||
rabbitmq_erlang_cookie=cookiemonster
|
|
||||||
|
|
||||||
# Use a local distribution build container image for building the AWX package
|
# Use a local distribution build container image for building the AWX package
|
||||||
# This is helpful if you don't want to bother installing the build-time dependencies as
|
# This is helpful if you don't want to bother installing the build-time dependencies as
|
||||||
# it is taken care of already.
|
# it is taken care of already.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ source /etc/tower/conf.d/environment.sh
|
|||||||
|
|
||||||
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$DATABASE_HOST port=$DATABASE_PORT" all
|
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$DATABASE_HOST port=$DATABASE_PORT" all
|
||||||
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$MEMCACHED_HOST port=$MEMCACHED_PORT" all
|
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$MEMCACHED_HOST port=$MEMCACHED_PORT" all
|
||||||
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$RABBITMQ_HOST port=$RABBITMQ_PORT" all
|
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$REDIS_HOST port=$REDIS_PORT" all
|
||||||
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m postgresql_db --become-user $DATABASE_USER -a "name=$DATABASE_NAME owner=$DATABASE_USER login_user=$DATABASE_USER login_host=$DATABASE_HOST login_password=$DATABASE_PASSWORD port=$DATABASE_PORT" all
|
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m postgresql_db --become-user $DATABASE_USER -a "name=$DATABASE_NAME owner=$DATABASE_USER login_user=$DATABASE_USER login_host=$DATABASE_HOST login_password=$DATABASE_PASSWORD port=$DATABASE_PORT" all
|
||||||
|
|
||||||
awx-manage collectstatic --noinput --clear
|
awx-manage collectstatic --noinput --clear
|
||||||
|
|||||||
@@ -85,17 +85,14 @@ DATABASES = {
|
|||||||
if os.getenv("DATABASE_SSLMODE", False):
|
if os.getenv("DATABASE_SSLMODE", False):
|
||||||
DATABASES['default']['OPTIONS'] = {'sslmode': os.getenv("DATABASE_SSLMODE")}
|
DATABASES['default']['OPTIONS'] = {'sslmode': os.getenv("DATABASE_SSLMODE")}
|
||||||
|
|
||||||
BROKER_URL = 'amqp://{}:{}@{}:{}/{}'.format(
|
BROKER_URL = 'redis://{}:{}'.format(
|
||||||
os.getenv("RABBITMQ_USER", None),
|
os.getenv("REDIS_HOST", None),
|
||||||
os.getenv("RABBITMQ_PASSWORD", None),
|
os.getenv("REDIS_PORT", "6379"),
|
||||||
os.getenv("RABBITMQ_HOST", None),
|
|
||||||
os.getenv("RABBITMQ_PORT", "5672"),
|
|
||||||
os.getenv("RABBITMQ_VHOST", "tower"))
|
|
||||||
|
|
||||||
CHANNEL_LAYERS = {
|
CHANNEL_LAYERS = {
|
||||||
'default': {'BACKEND': 'asgi_amqp.AMQPChannelLayer',
|
'default': {'BACKEND': 'asgi_amqp.AMQPChannelLayer',
|
||||||
'ROUTING': 'awx.main.routing.channel_routing',
|
'ROUTING': 'awx.main.routing.channel_routing',
|
||||||
'CONFIG': {'url': BROKER_URL}}
|
'CONFIG': {'hosts': [(os.getenv("REDIS_HOST", None), int(os.getenv("REDIS_PORT", 6379)))]}}
|
||||||
}
|
}
|
||||||
|
|
||||||
USE_X_FORWARDED_PORT = True
|
USE_X_FORWARDED_PORT = True
|
||||||
|
|||||||
@@ -26,19 +26,8 @@ stdout_logfile_maxbytes=0
|
|||||||
stderr_logfile=/dev/stderr
|
stderr_logfile=/dev/stderr
|
||||||
stderr_logfile_maxbytes=0
|
stderr_logfile_maxbytes=0
|
||||||
|
|
||||||
[program:channels-worker]
|
|
||||||
command = awx-manage runworker --only-channels websocket.*
|
|
||||||
directory = /var/lib/awx
|
|
||||||
autostart = true
|
|
||||||
autorestart = true
|
|
||||||
stopwaitsecs = 5
|
|
||||||
stdout_logfile=/dev/stdout
|
|
||||||
stdout_logfile_maxbytes=0
|
|
||||||
stderr_logfile=/dev/stderr
|
|
||||||
stderr_logfile_maxbytes=0
|
|
||||||
|
|
||||||
[group:tower-processes]
|
[group:tower-processes]
|
||||||
programs=dispatcher,callback-receiver,channels-worker
|
programs=dispatcher,callback-receiver
|
||||||
priority=5
|
priority=5
|
||||||
|
|
||||||
# TODO: Exit Handler
|
# TODO: Exit Handler
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ source /etc/tower/conf.d/environment.sh
|
|||||||
|
|
||||||
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$DATABASE_HOST port=$DATABASE_PORT" all
|
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$DATABASE_HOST port=$DATABASE_PORT" all
|
||||||
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$MEMCACHED_HOST port=$MEMCACHED_PORT" all
|
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$MEMCACHED_HOST port=$MEMCACHED_PORT" all
|
||||||
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$RABBITMQ_HOST port=$RABBITMQ_PORT" all
|
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$REDIS_HOST port=$REDIS_PORT" all
|
||||||
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m postgresql_db --become-user $DATABASE_USER -a "name=$DATABASE_NAME owner=$DATABASE_USER login_user=$DATABASE_USER login_host=$DATABASE_HOST login_password=$DATABASE_PASSWORD port=$DATABASE_PORT" all
|
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m postgresql_db --become-user $DATABASE_USER -a "name=$DATABASE_NAME owner=$DATABASE_USER login_user=$DATABASE_USER login_host=$DATABASE_HOST login_password=$DATABASE_PASSWORD port=$DATABASE_PORT" all
|
||||||
|
|
||||||
if [ -z "$AWX_SKIP_MIGRATIONS" ]; then
|
if [ -z "$AWX_SKIP_MIGRATIONS" ]; then
|
||||||
|
|||||||
@@ -1,19 +1,13 @@
|
|||||||
---
|
---
|
||||||
dockerhub_version: "{{ lookup('file', playbook_dir + '/../VERSION') }}"
|
dockerhub_version: "{{ lookup('file', playbook_dir + '/../VERSION') }}"
|
||||||
|
|
||||||
rabbitmq_version: "3.7.4"
|
redis_image: "redis"
|
||||||
rabbitmq_image: "ansible/awx_rabbitmq:{{rabbitmq_version}}"
|
redis_hostname: "redis"
|
||||||
rabbitmq_default_vhost: "awx"
|
redis_port: "6379"
|
||||||
rabbitmq_erlang_cookie: "cookiemonster"
|
|
||||||
rabbitmq_hostname: "rabbitmq"
|
|
||||||
rabbitmq_port: "5672"
|
|
||||||
rabbitmq_user: "guest"
|
|
||||||
rabbitmq_password: "guest"
|
|
||||||
|
|
||||||
postgresql_version: "10"
|
postgresql_version: "10"
|
||||||
postgresql_image: "postgres:{{postgresql_version}}"
|
postgresql_image: "postgres:{{postgresql_version}}"
|
||||||
|
|
||||||
|
|
||||||
memcached_image: "memcached"
|
memcached_image: "memcached"
|
||||||
memcached_version: "alpine"
|
memcached_version: "alpine"
|
||||||
memcached_hostname: "memcached"
|
memcached_hostname: "memcached"
|
||||||
|
|||||||
@@ -10,17 +10,13 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BROKER_URL = 'amqp://{}:{}@{}:{}/{}'.format(
|
BROKER_URL = 'redis://{}:{}/'.format(
|
||||||
"{{ rabbitmq_user }}",
|
"{{ redis_hostname }}",
|
||||||
"{{ rabbitmq_password }}",
|
"{{ redis_port }}",)
|
||||||
"{{ rabbitmq_hostname | default('rabbitmq')}}",
|
|
||||||
"{{ rabbitmq_port }}",
|
|
||||||
"{{ rabbitmq_default_vhost }}")
|
|
||||||
|
|
||||||
CHANNEL_LAYERS = {
|
CHANNEL_LAYERS = {
|
||||||
'default': {'BACKEND': 'asgi_amqp.AMQPChannelLayer',
|
'default': {'BACKEND': 'awx.main.channels.RedisGroupBroadcastChannelLayer',
|
||||||
'ROUTING': 'awx.main.routing.channel_routing',
|
'CONFIG': {'hosts': [("{{ redis_hostname }}", {{ redis_port|int }})]}}
|
||||||
'CONFIG': {'url': BROKER_URL}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CACHES = {
|
CACHES = {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ services:
|
|||||||
image: {{ awx_web_docker_actual_image }}
|
image: {{ awx_web_docker_actual_image }}
|
||||||
container_name: awx_web
|
container_name: awx_web
|
||||||
depends_on:
|
depends_on:
|
||||||
- rabbitmq
|
- redis
|
||||||
- memcached
|
- memcached
|
||||||
{% if pg_hostname is not defined %}
|
{% if pg_hostname is not defined %}
|
||||||
- postgres
|
- postgres
|
||||||
@@ -63,7 +63,7 @@ services:
|
|||||||
image: {{ awx_task_docker_actual_image }}
|
image: {{ awx_task_docker_actual_image }}
|
||||||
container_name: awx_task
|
container_name: awx_task
|
||||||
depends_on:
|
depends_on:
|
||||||
- rabbitmq
|
- redis
|
||||||
- memcached
|
- memcached
|
||||||
- web
|
- web
|
||||||
{% if pg_hostname is not defined %}
|
{% if pg_hostname is not defined %}
|
||||||
@@ -111,15 +111,11 @@ services:
|
|||||||
https_proxy: {{ https_proxy | default('') }}
|
https_proxy: {{ https_proxy | default('') }}
|
||||||
no_proxy: {{ no_proxy | default('') }}
|
no_proxy: {{ no_proxy | default('') }}
|
||||||
|
|
||||||
rabbitmq:
|
redis:
|
||||||
image: {{ rabbitmq_image }}
|
image: {{ redis_image }}
|
||||||
container_name: awx_rabbitmq
|
container_name: awx_redis
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
RABBITMQ_DEFAULT_VHOST: "{{ rabbitmq_default_vhost }}"
|
|
||||||
RABBITMQ_DEFAULT_USER: "{{ rabbitmq_user }}"
|
|
||||||
RABBITMQ_DEFAULT_PASS: "{{ rabbitmq_password | quote }}"
|
|
||||||
RABBITMQ_ERLANG_COOKIE: {{ rabbitmq_erlang_cookie }}
|
|
||||||
http_proxy: {{ http_proxy | default('') }}
|
http_proxy: {{ http_proxy | default('') }}
|
||||||
https_proxy: {{ https_proxy | default('') }}
|
https_proxy: {{ https_proxy | default('') }}
|
||||||
no_proxy: {{ no_proxy | default('') }}
|
no_proxy: {{ no_proxy | default('') }}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ DATABASE_ADMIN_PASSWORD={{ pg_admin_password|quote }}
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
MEMCACHED_HOST={{ memcached_hostname|default('memcached') }}
|
MEMCACHED_HOST={{ memcached_hostname|default('memcached') }}
|
||||||
MEMCACHED_PORT={{ memcached_port|default('11211')|quote }}
|
MEMCACHED_PORT={{ memcached_port|default('11211')|quote }}
|
||||||
RABBITMQ_HOST={{ rabbitmq_hostname|default('rabbitmq')|quote }}
|
REDIS_HOST={{ redis_hostname|quote }}
|
||||||
RABBITMQ_PORT={{ rabbitmq_port|default('5672')|quote }}
|
REDIS_PORT={{ redis_port|quote }}
|
||||||
AWX_ADMIN_USER={{ admin_user|quote }}
|
AWX_ADMIN_USER={{ admin_user|quote }}
|
||||||
AWX_ADMIN_PASSWORD={{ admin_password|quote }}
|
AWX_ADMIN_PASSWORD={{ admin_password|quote }}
|
||||||
|
|||||||
Reference in New Issue
Block a user