2022-11-24 15:40:41 +00:00
|
|
|
---
|
2023-11-21 15:35:05 +00:00
|
|
|
- name: 'Wait for the DB to be available'
|
|
|
|
wait_for:
|
|
|
|
port: '{{ postgres_ha_cont_port }}'
|
|
|
|
delay: 5
|
|
|
|
|
2022-11-24 15:40:41 +00:00
|
|
|
- name: 'Allow VPN connections in HBA config'
|
|
|
|
register: postgres_ha_hba
|
|
|
|
blockinfile:
|
|
|
|
path: '{{ postgres_ha_cont_data_vol }}/pgdata/pg_hba.conf'
|
|
|
|
marker: '# {mark} ANSIBLE MANAGED REPLICATORS'
|
|
|
|
block: |
|
|
|
|
{% for addr in postgres_ha_replica_allowed_addresses %}
|
|
|
|
host replication replicator {{ addr }} md5
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
- name: 'Restart database container'
|
|
|
|
when: postgres_ha_hba.changed
|
2024-05-30 14:29:14 +00:00
|
|
|
community.docker.docker_compose_v2:
|
2023-11-22 11:09:05 +00:00
|
|
|
project_src: '{{ postgres_ha_service_path }}'
|
|
|
|
files: '{{ postgres_ha_compose_file }}'
|
2024-05-30 14:29:14 +00:00
|
|
|
state: restarted
|