]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/commit
standby-clone: Allow cloning of standby server with pg_basebackup
authorPaul B <paul@bonaud.fr>
Thu, 28 May 2020 16:41:49 +0000 (18:41 +0200)
committerPaul B <paul@bonaud.fr>
Fri, 5 Jun 2020 12:37:21 +0000 (14:37 +0200)
commitb722248ed7c4a7aba2b047855b983d72a9725209
treec76ddecb3b0434e45f481e8b0585e3b62ae31bb0
parent9e6f9658fbf5db657a2dd8465bf0ae4f41da161e
standby-clone: Allow cloning of standby server with pg_basebackup

Right now the role assumes you have a base backup available with
Barman. However if you don't have an initial barman backup you might
want to clone the primary server directly to setup your standby
server.

This PR adds a new `primary.pg_basebackup` option to the cluster
configuration which if enabled (set to `true`) will create a
`/root/standby-clone-{{ postgres_version }}-{{ postgres_cluster_name }}.sh`
script on the standby server which helps to initialise a standby
server.

⚠️ Breaking change: the current role behavior which creates a cloning
script fetching the initial backup from barman will not be
enabled by default anymore. You will need to add the new
`primary.restore_barman_directory` option in your role
configuration to do so. ⚠️
tasks/postgres-cluster.yml
tasks/postgres-standby-barman.yml
tasks/postgres-standby-basebackup.yml [new file with mode: 0644]
templates/standby-barman-clone.sh.j2 [moved from templates/standby-clone.sh.j2 with 100% similarity]
templates/standby-pg_basebackup-clone.sh.j2 [new file with mode: 0755]