blob: 75fb72b6313e54ae86c31eddcb088ba449b41911 [file] [log] [blame] [edit]
---
# tasks file for apigee-opdk-setup-postgres-standby
- block:
- name: Clear the pgdata folder
become: yes
file:
path: "{{ apigee_postgresql_data_dir }}"
state: absent
- name: Postgres replication standby
shell: '/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-standby -f {{ opdk_installation_config_file }}'
register: replication_output
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: '/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-standby -f {{ opdk_installation_config_file }}'
- name: Ensure component is started
shell: "{{ apigee_all }} start"
- name: Wait for ready
command: '/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql wait_for_ready'
when: validate_ready | default(true)