From 66f03c3c16431cb4f1483ae4d1d630b41721f145 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:47:35 -0500 Subject: [PATCH] Adopt LISTENER_DATABASES setting (#1687) Related to https://github.com/ansible/awx/pull/14755 move TCP keepalive to pg_listener specific db setting --- .../templates/settings/credentials.py.j2 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/roles/installer/templates/settings/credentials.py.j2 b/roles/installer/templates/settings/credentials.py.j2 index 9b3241d2c..19208e0bd 100644 --- a/roles/installer/templates/settings/credentials.py.j2 +++ b/roles/installer/templates/settings/credentials.py.j2 @@ -11,13 +11,20 @@ DATABASES = { {% if awx_postgres_sslmode in ['verify-ca', 'verify-full'] %} 'sslrootcert': '{{ ca_trust_bundle }}', {% endif %} + }, + } +} + +LISTENER_DATABASES = { + 'default': { + 'OPTIONS': { {% if postgres_keepalives %} - 'keepalives': 1, - 'keepalives_idle': {{ postgres_keepalives_idle }}, - 'keepalives_interval': {{ postgres_keepalives_interval }}, - 'keepalives_count': {{ postgres_keepalives_count }}, + 'keepalives': 1, + 'keepalives_idle': {{ postgres_keepalives_idle }}, + 'keepalives_interval': {{ postgres_keepalives_interval }}, + 'keepalives_count': {{ postgres_keepalives_count }}, {% else %} - 'keepalives': 0, + 'keepalives': 0, {% endif %} }, }