Skip to content

Commit

Permalink
fix replication
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahms authored and vibhorkumar123 committed Aug 8, 2023
1 parent 9d12298 commit 4bff825
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions roles/execute_binary_upgrade/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions roles/execute_binary_upgrade/tasks/upgrade_standbys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

0 comments on commit 4bff825

Please sign in to comment.