1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Merge pull request #3720 from shanemcd/memcache-config

Fix memcached configuration in local Docker installs

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-04-16 19:53:23 +00:00 committed by GitHub
commit 15ef095366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 15 deletions

View File

@ -99,16 +99,4 @@ CHANNEL_LAYERS = {
'CONFIG': {'url': BROKER_URL}} 'CONFIG': {'url': BROKER_URL}}
} }
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '{}:{}'.format(os.getenv("MEMCACHED_HOST", None),
os.getenv("MEMCACHED_PORT", "11211"))
},
'ephemeral': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
}
USE_X_FORWARDED_PORT = True USE_X_FORWARDED_PORT = True

View File

@ -5,9 +5,14 @@ rabbitmq_version: "3.7.4"
rabbitmq_image: "ansible/awx_rabbitmq:{{rabbitmq_version}}" rabbitmq_image: "ansible/awx_rabbitmq:{{rabbitmq_version}}"
rabbitmq_default_vhost: "awx" rabbitmq_default_vhost: "awx"
rabbitmq_erlang_cookie: "cookiemonster" rabbitmq_erlang_cookie: "cookiemonster"
rabbitmq_host: "rabbitmq"
rabbitmq_port: "5672" rabbitmq_port: "5672"
rabbitmq_user: "guest" rabbitmq_user: "guest"
rabbitmq_password: "guest" rabbitmq_password: "guest"
postgresql_version: "9.6" postgresql_version: "9.6"
postgresql_image: "postgres:{{postgresql_version}}" postgresql_image: "postgres:{{postgresql_version}}"
memcached_host: "memcached"
memcached_port: "11211"

View File

@ -20,10 +20,12 @@
content: "{{ secret_key }}" content: "{{ secret_key }}"
dest: "{{ docker_compose_dir }}/SECRET_KEY" dest: "{{ docker_compose_dir }}/SECRET_KEY"
mode: 0600 mode: 0600
register: awx_secret_key
- name: Start the containers - name: Start the containers
docker_service: docker_service:
project_src: "{{ docker_compose_dir }}" project_src: "{{ docker_compose_dir }}"
restarted: "{{ awx_compose_config is changed or awx_secret_key is changed }}"
register: awx_compose_start register: awx_compose_start
- name: Update CA trust in awx_web container - name: Update CA trust in awx_web container

View File

@ -5,15 +5,16 @@ DATABASES = {
'NAME': "{{ pg_database }}", 'NAME': "{{ pg_database }}",
'USER': "{{ pg_username }}", 'USER': "{{ pg_username }}",
'PASSWORD': "{{ pg_password }}", 'PASSWORD': "{{ pg_password }}",
'HOST': "{{ pg_hostname|default('postgres') }}", 'HOST': "{{ pg_hostname | default('postgres') }}",
'PORT': "{{ pg_port }}", 'PORT': "{{ pg_port }}",
} }
} }
BROKER_URL = 'amqp://{}:{}@{}:{}/{}'.format( BROKER_URL = 'amqp://{}:{}@{}:{}/{}'.format(
"{{ rabbitmq_user }}", "{{ rabbitmq_user }}",
"{{ rabbitmq_password }}", "{{ rabbitmq_password }}",
"rabbitmq", "{{ rabbitmq_host }}",
"5672", "{{ rabbitmq_port }}",
"awx") "awx")
CHANNEL_LAYERS = { CHANNEL_LAYERS = {
@ -21,3 +22,13 @@ CHANNEL_LAYERS = {
'ROUTING': 'awx.main.routing.channel_routing', 'ROUTING': 'awx.main.routing.channel_routing',
'CONFIG': {'url': BROKER_URL}} 'CONFIG': {'url': BROKER_URL}}
} }
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '{}:{}'.format("{{ memcached_host }}", "{{ memcached_port }}")
},
'ephemeral': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
}