This commit is contained in:
2026-01-29 12:55:01 +01:00
commit 65edf17dc7
15 changed files with 435 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
- name: Stop postgres on primary
service:
name: postgresql
state: stopped
- name: Remove old data on primary
file:
path: "{{ pg_data }}"
state: absent
- name: Restore base backup from replica
become_user: postgres
command: >
pg_basebackup -h pg2 -D {{ pg_data }} -U replicator -Fp -Xs -P -R
- name: Start postgres on primary
service:
name: postgresql
state: started