mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 01:28:09 -03:30
Add optional pgbouncer to dev environment (#14083)
Signed-off-by: Rick Elrod <rick@elrod.me>
This commit is contained in:
@@ -35,3 +35,8 @@ enable_splunk: false
|
||||
enable_grafana: false
|
||||
enable_prometheus: false
|
||||
scrape_interval: '5s'
|
||||
|
||||
# pgbouncer
|
||||
enable_pgbouncer: false
|
||||
pgbouncer_port: 6432
|
||||
pgbouncer_max_pool_size: 70
|
||||
|
||||
@@ -5,7 +5,12 @@ DATABASES = {
|
||||
'NAME': "{{ pg_database }}",
|
||||
'USER': "{{ pg_username }}",
|
||||
'PASSWORD': "{{ pg_password }}",
|
||||
{% if enable_pgbouncer|bool %}
|
||||
'HOST': "pgbouncer",
|
||||
'PORT': "{{ pgbouncer_port }}",
|
||||
{% else %}
|
||||
'HOST': "{{ pg_hostname | default('postgres') }}",
|
||||
'PORT': "{{ pg_port }}",
|
||||
{% endif %}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,6 +201,25 @@ services:
|
||||
POSTGRES_PASSWORD: {{ pg_password }}
|
||||
volumes:
|
||||
- "awx_db:/var/lib/postgresql/data"
|
||||
{% if enable_pgbouncer|bool %}
|
||||
pgbouncer:
|
||||
image: bitnami/pgbouncer:latest
|
||||
container_name: tools_pgbouncer_1
|
||||
hostname: pgbouncer
|
||||
environment:
|
||||
POSTGRESQL_USERNAME: {{ pg_username }}
|
||||
POSTGRESQL_DATABASE: {{ pg_database }}
|
||||
PGBOUNCER_DATABASE: {{ pg_database }}
|
||||
POSTGRESQL_PASSWORD: {{ pg_password }}
|
||||
POSTGRESQL_HOST: {{ pg_hostname | default('postgres') }}
|
||||
POSTGRESQL_PORT: {{ pg_port }}
|
||||
PGBOUNCER_AUTH_TYPE: trust
|
||||
PGBOUNCER_PORT: {{ pgbouncer_port }}
|
||||
PGBOUNCER_DEFAULT_POOL_SIZE: {{ pgbouncer_max_pool_size }}
|
||||
# This is the default, but we're being explicit here because it's important:
|
||||
# pg_notify will NOT work in transaction mode.
|
||||
PGBOUNCER_POOL_MODE: session
|
||||
{% endif %}
|
||||
{% if execution_node_count|int > 0 %}
|
||||
receptor-hop:
|
||||
image: {{ receptor_image }}
|
||||
|
||||
Reference in New Issue
Block a user