From 7d2dbb22925a177fc5583f7c32254e67f68f0f21 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Wed, 9 Nov 2022 10:09:22 +0100 Subject: [PATCH 1/2] [postgresql_server] Support postgresql 14 Set password_encryption to default scram-sha-256. This was introduced in version 14. (cherry picked from commit 31750699f88b1da71e5e2a53cf8c91a06466ff86) --- .../templates/etc/postgresql/postgresql.conf.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/roles/postgresql_server/templates/etc/postgresql/postgresql.conf.j2 b/ansible/roles/postgresql_server/templates/etc/postgresql/postgresql.conf.j2 index d9e11bd0da..38eee5f57d 100644 --- a/ansible/roles/postgresql_server/templates/etc/postgresql/postgresql.conf.j2 +++ b/ansible/roles/postgresql_server/templates/etc/postgresql/postgresql.conf.j2 @@ -71,7 +71,11 @@ ssl_prefer_server_ciphers = {{ item.ssl_prefer_server_ciphers | d('on') }} ssl_ecdh_curve = {{ item.ssl_ecdh_curve | d('prime256v1') }} {% endif %} +{% if (item.version | d(postgresql_server__version)) is version_compare('14','>=') %} +password_encryption = {{ item.password_encryption | d('scram-sha-256') }} +{% else %} password_encryption = {{ item.password_encryption | d('on') }} +{% endif %} db_user_namespace = {{ item.db_user_namespace | d('off') }} From 9971624be146d6f15eefbacd514c8fcc109902c2 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Wed, 9 Nov 2022 10:12:53 +0100 Subject: [PATCH 2/2] [postgresql_server] Support postgresql 15 The stats_temp_directory entry was obsoleted with version 15. (cherry picked from commit 4f2efcdd40b120bec198713d8b5bc1e15e9a6de9) --- .../templates/etc/postgresql/postgresql.conf.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/roles/postgresql_server/templates/etc/postgresql/postgresql.conf.j2 b/ansible/roles/postgresql_server/templates/etc/postgresql/postgresql.conf.j2 index 38eee5f57d..9ce22b8521 100644 --- a/ansible/roles/postgresql_server/templates/etc/postgresql/postgresql.conf.j2 +++ b/ansible/roles/postgresql_server/templates/etc/postgresql/postgresql.conf.j2 @@ -375,7 +375,8 @@ track_io_timing = {{ item.track_io_timing | d('off') }} track_functions = {{ item.track_functions | d('none') }} track_activity_query_size = {{ item.track_activity_query_size | d('1024') }} update_process_title = {{ item.update_process_title | d('on') }} -{% if (item.version | d(postgresql_server__version)) is version_compare('9.1','>') %} +{% if (item.version | d(postgresql_server__version)) is version_compare('15','>=') %} +{% elif (item.version | d(postgresql_server__version)) is version_compare('9.1','>') %} stats_temp_directory = '{{ item.stats_temp_directory | d("/var/run/postgresql/" + (item.version | d(postgresql_server__version)) + "-" + item.name + ".pg_stat_tmp") }}' {% else %} stats_temp_directory = '{{ item.stats_temp_directory | d("pg_stat_tmp") }}'