| --- |
| # tasks file for apigee-opdk-setup-postgres-standby |
| - block: |
| - name: Clear the pgdata folder |
| file: |
| path: "{{ apigee_postgresql_data_dir }}" |
| state: absent |
| |
| - name: Postgres replication standby |
| shell: '{{ apigee_service }} apigee-postgresql setup-replication-on-standby -f {{ opdk_installation_config_file }}' |
| |
| rescue: |
| - name: Determine if max_wal_senders value must be updated |
| set_fact: |
| update_max_wal_settings: "{{ replication_output.stdout | search('number of requested standby connections exceeds max_wal_senders') }}" |
| |
| - name: Postgres replication standby |
| shell: '{{ apigee_service }} apigee-postgresql setup-replication-on-standby -f {{ opdk_installation_config_file }}' |
| |
| #- block: |
| - name: Ensure component is started |
| shell: "{{ apigee_service }} apigee-postgresql start" |
| |
| - name: Give the server some extra time |
| pause: |
| minutes: 1 |
| when: opdk_version | version_compare('4.17.01', '>=') and opdk_version | version_compare('4.17.09', '<=') |
| |
| - name: Wait for ready |
| command: '{{ apigee_all }} wait_for_ready' |
| when: validate_ready | default(true) |
| |
| - name: Validate postgres replication standby |
| shell: '{{ apigee_service }} apigee-postgresql postgres-check-standby' |
| |
| # rescue: |
| # - name: Ensure component is started |
| # shell: "{{ apigee_service }} apigee-postgresql start" |
| # |
| # - name: Wait for ready |
| # command: '{{ apigee_all }} wait_for_ready' |
| # when: validate_ready | default(true) |
| # |
| # - name: Validate postgres replication standby |
| # shell: '{{ apigee_service }} apigee-postgresql postgres-check-standby' |