From fbe6922767d824eb242bde1cd545131183c5e732 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Fri, 8 Nov 2024 11:59:47 +0000 Subject: [PATCH] pg_old_bindir --- automation/roles/upgrade/tasks/initdb.yml | 2 +- automation/roles/upgrade/tasks/schema_compatibility.yml | 4 ++-- automation/roles/upgrade/tasks/stop_services.yml | 6 +++--- automation/roles/upgrade/tasks/upgrade_check.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/automation/roles/upgrade/tasks/initdb.yml b/automation/roles/upgrade/tasks/initdb.yml index 098ee853c..21ce13b0c 100644 --- a/automation/roles/upgrade/tasks/initdb.yml +++ b/automation/roles/upgrade/tasks/initdb.yml @@ -40,7 +40,7 @@ - name: Get the current install user ansible.builtin.command: >- - {{ postgresql_bin_dir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc + {{ pg_old_bindir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc "select rolname from pg_roles where oid = 10" changed_when: false register: pg_install_user diff --git a/automation/roles/upgrade/tasks/schema_compatibility.yml b/automation/roles/upgrade/tasks/schema_compatibility.yml index a1bb81c2f..e05084c13 100644 --- a/automation/roles/upgrade/tasks/schema_compatibility.yml +++ b/automation/roles/upgrade/tasks/schema_compatibility.yml @@ -2,7 +2,7 @@ - name: Get the current shared_preload_libraries settings ansible.builtin.command: >- - {{ postgresql_bin_dir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc + {{ pg_old_bindir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc "show shared_preload_libraries" changed_when: false register: pg_shared_preload_libraries @@ -11,7 +11,7 @@ - name: Get the current cron.database_name settings ansible.builtin.command: >- - {{ postgresql_bin_dir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc + {{ pg_old_bindir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc "select current_setting('cron.database_name', true)" changed_when: false register: pg_cron_database_name diff --git a/automation/roles/upgrade/tasks/stop_services.yml b/automation/roles/upgrade/tasks/stop_services.yml index ccaa04fb7..93bbe776e 100644 --- a/automation/roles/upgrade/tasks/stop_services.yml +++ b/automation/roles/upgrade/tasks/stop_services.yml @@ -2,7 +2,7 @@ - name: "Execute CHECKPOINT before stopping PostgreSQL" ansible.builtin.command: > - {{ postgresql_bin_dir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc "CHECKPOINT" + {{ pg_old_bindir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc "CHECKPOINT" async: "{{ pg_start_stop_timeout | int }}" # run the command asynchronously poll: 0 register: checkpoint_result @@ -18,7 +18,7 @@ # Wait for the window to appear without high replication lag before stopping PostgreSQL - name: "Wait until replication lag is less than {{ max_replication_lag_bytes | human_readable }}" ansible.builtin.command: >- - {{ postgresql_bin_dir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc + {{ pg_old_bindir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc "select coalesce(max(pg_wal_lsn_diff(pg_current_wal_lsn(),replay_lsn)),1) as pg_lag_bytes from pg_stat_replication" register: pg_lag_bytes @@ -51,7 +51,7 @@ # for compatibility with Postgres 9.x - name: "Wait until replication lag is less than {{ max_replication_lag_bytes | human_readable }}" ansible.builtin.command: >- - {{ postgresql_bin_dir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc + {{ pg_old_bindir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc "select coalesce(max(pg_xlog_location_diff(pg_current_xlog_location(),replay_location)),1) as pg_lag_bytes from pg_stat_replication" register: pg_lag_bytes_9x diff --git a/automation/roles/upgrade/tasks/upgrade_check.yml b/automation/roles/upgrade/tasks/upgrade_check.yml index ea16e0a49..ca02334b2 100644 --- a/automation/roles/upgrade/tasks/upgrade_check.yml +++ b/automation/roles/upgrade/tasks/upgrade_check.yml @@ -2,7 +2,7 @@ - name: Get the current shared_preload_libraries settings ansible.builtin.command: >- - {{ postgresql_bin_dir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc + {{ pg_old_bindir }}/psql -p {{ postgresql_port }} -U {{ patroni_superuser_username }} -d postgres -tAXc "show shared_preload_libraries" changed_when: false register: pg_shared_preload_libraries_result