From b71473c4fe27c5330599d8e3d2e2c9708ff422c1 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Sat, 28 Jan 2023 19:32:34 +0300 Subject: [PATCH] postgresql_version: 15 by default --- roles/patroni/tasks/main.yml | 2 ++ roles/patroni/templates/patroni.yml.j2 | 2 +- vars/Debian.yml | 1 + vars/RedHat.yml | 1 + vars/main.yml | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/patroni/tasks/main.yml b/roles/patroni/tasks/main.yml index 9f29b15fc..1f41a6155 100644 --- a/roles/patroni/tasks/main.yml +++ b/roles/patroni/tasks/main.yml @@ -333,6 +333,7 @@ when: - postgresql_stats_temp_directory_path is defined - postgresql_stats_temp_directory_path != 'none' + - postgresql_version is version('14', '<=') tags: patroni, pgsql_stats_tmp - name: Prepare PostgreSQL | mount the statistics directory in memory (tmpfs) @@ -345,6 +346,7 @@ when: - postgresql_stats_temp_directory_path is defined - postgresql_stats_temp_directory_path != 'none' + - postgresql_version is version('14', '<=') tags: patroni, pgsql_stats_tmp - name: Prepare PostgreSQL | make sure the postgresql log directory "{{ postgresql_log_dir }}" exists diff --git a/roles/patroni/templates/patroni.yml.j2 b/roles/patroni/templates/patroni.yml.j2 index b196ba1dd..6c55080af 100644 --- a/roles/patroni/templates/patroni.yml.j2 +++ b/roles/patroni/templates/patroni.yml.j2 @@ -136,7 +136,7 @@ postgresql: # password: rewind_password parameters: unix_socket_directories: {{ postgresql_unix_socket_dir }} -{% if postgresql_stats_temp_directory_path is defined and postgresql_stats_temp_directory_path != 'none' %} +{% if postgresql_stats_temp_directory_path is defined and postgresql_stats_temp_directory_path != 'none' and postgresql_version is version('14', '<=') %} stats_temp_directory: {{ postgresql_stats_temp_directory_path }} {% endif %} diff --git a/vars/Debian.yml b/vars/Debian.yml index 3240fadf6..81b472ac5 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -11,6 +11,7 @@ postgresql_unix_socket_dir: "/var/run/postgresql" postgresql_home_dir: "/var/lib/postgresql" # stats_temp_directory (mount the statistics directory in tmpfs) +# if postgresql_version < 15 postgresql_stats_temp_directory_path: "/var/lib/pgsql_stats_tmp" # or 'none' postgresql_stats_temp_directory_size: "1024m" diff --git a/vars/RedHat.yml b/vars/RedHat.yml index f8346599c..15daa4352 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -10,6 +10,7 @@ postgresql_unix_socket_dir: "/var/run/postgresql" postgresql_home_dir: "/var/lib/pgsql" # stats_temp_directory (mount the statistics directory in tmpfs) +# if postgresql_version < 15 postgresql_stats_temp_directory_path: "/var/lib/pgsql_stats_tmp" # or 'none' postgresql_stats_temp_directory_size: "1024m" diff --git a/vars/main.yml b/vars/main.yml index e59f36101..7b773a478 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -130,7 +130,7 @@ consul_services: # PostgreSQL variables -postgresql_version: "14" +postgresql_version: "15" # postgresql_data_dir: see vars/Debian.yml or vars/RedHat.yml postgresql_port: "5432" postgresql_encoding: "UTF8" # for bootstrap only (initdb)