From 4bff8252841bdfd1afcb615b601c8ed421ca0f0c Mon Sep 17 00:00:00 2001 From: hannahms <36494235+hannahms@users.noreply.github.com> Date: Wed, 2 Aug 2023 16:10:29 -0400 Subject: [PATCH] fix replication --- roles/execute_binary_upgrade/defaults/main.yml | 4 ++-- roles/execute_binary_upgrade/tasks/upgrade_standbys.yml | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/roles/execute_binary_upgrade/defaults/main.yml b/roles/execute_binary_upgrade/defaults/main.yml index acce8839..02de450f 100644 --- a/roles/execute_binary_upgrade/defaults/main.yml +++ b/roles/execute_binary_upgrade/defaults/main.yml @@ -37,8 +37,8 @@ pg_replication_user: "repuser" pg_replication_user_password: "" synchronous_standby_names: "" standby_quorum_type: "any" -pg_basebackup: "{{ new_pg_bin_path }}/pg_basebackup -Fp -R -l standby --checkpoint=fast --wal-method=stream" -pg_basebackup_options: "" +new_pg_basebackup: "{{ new_pg_bin_path }}/pg_basebackup -Fp -R -l standby --checkpoint=fast --wal-method=stream" +new_pg_basebackup_options: "" # setting validate_only to true allows you to validate setup on an existing node # use_validation flag applies to deployment configuration and validation after setup diff --git a/roles/execute_binary_upgrade/tasks/upgrade_standbys.yml b/roles/execute_binary_upgrade/tasks/upgrade_standbys.yml index 28c799ac..9e8558b5 100644 --- a/roles/execute_binary_upgrade/tasks/upgrade_standbys.yml +++ b/roles/execute_binary_upgrade/tasks/upgrade_standbys.yml @@ -16,6 +16,12 @@ become: true when: "'standby' in group_names" +# if not defined here, it will not include the new_pg_version and new_pg_bin_path variables in pg_basebackup +- name: Set fact for pg_basebackup options + ansible.builtin.set_fact: + pg_basebackup: "{{ new_pg_basebackup }}" + pg_basebackup_options: "{{ new_pg_basebackup_options }}" + - name: Include setup_replication role for standby's when not use_link_method ansible.builtin.include_role: name: setup_replication @@ -30,9 +36,6 @@ pg_initdb: "{{ new_pg_initdb }}" pg_initdb_options: "{{ new_pg_initdb_options }}" pg_port: "{{ new_pg_port }}" - pg_basebackup: "{{ pg_basebackup }}" - pg_basebackup_options: "{{ pg_basebackup_options }}" use_validation: false no_log: "{{ disable_logging }}" when: "'standby' in group_names" -