From ce48812921bf698b135236825e187d3233ddc225 Mon Sep 17 00:00:00 2001 From: Andrii Salnikov Date: Thu, 9 Feb 2023 00:57:19 +0100 Subject: [PATCH 1/2] add sslrootcert to database options conditionally (fixes #1215) --- roles/installer/templates/settings/credentials.py.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/installer/templates/settings/credentials.py.j2 b/roles/installer/templates/settings/credentials.py.j2 index 3f8f1380..c79b1bdb 100644 --- a/roles/installer/templates/settings/credentials.py.j2 +++ b/roles/installer/templates/settings/credentials.py.j2 @@ -8,7 +8,9 @@ DATABASES = { 'HOST': '{{ awx_postgres_host }}', 'PORT': "{{ awx_postgres_port }}", 'OPTIONS': { 'sslmode': '{{ awx_postgres_sslmode }}', + {%- if awx_postgres_sslmode == 'verify-ca' or awx_postgres_sslmode == 'verify-full' %} 'sslrootcert': '{{ ca_trust_bundle }}', + {%- endif %} }, } } From ef10b06be5d10dcabea83c5e2c4039adea3c39cc Mon Sep 17 00:00:00 2001 From: Andrii Salnikov Date: Thu, 23 Mar 2023 22:31:39 +0100 Subject: [PATCH 2/2] Update roles/installer/templates/settings/credentials.py.j2 Co-authored-by: Dimitri Savineau --- roles/installer/templates/settings/credentials.py.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/installer/templates/settings/credentials.py.j2 b/roles/installer/templates/settings/credentials.py.j2 index c79b1bdb..53e8fde1 100644 --- a/roles/installer/templates/settings/credentials.py.j2 +++ b/roles/installer/templates/settings/credentials.py.j2 @@ -8,9 +8,9 @@ DATABASES = { 'HOST': '{{ awx_postgres_host }}', 'PORT': "{{ awx_postgres_port }}", 'OPTIONS': { 'sslmode': '{{ awx_postgres_sslmode }}', - {%- if awx_postgres_sslmode == 'verify-ca' or awx_postgres_sslmode == 'verify-full' %} +{% if awx_postgres_sslmode in ['verify-ca', 'verify-full'] %} 'sslrootcert': '{{ ca_trust_bundle }}', - {%- endif %} +{% endif %} }, } }