]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blobdiff - templates/recovery.conf.j2
recovery: optional restore_command & allow custom command if needed
[github/fretlink/ansible-postgresql-role.git] / templates / recovery.conf.j2
index 059b2348c28feac1d44c14f6101583a42431d3bc..7078429ef62c8e197666d80da912155cd5d61950 100644 (file)
@@ -2,7 +2,11 @@
 # {{ ansible_managed }}
 
 standby_mode = 'on'
-restore_command = '/usr/bin/barman-wal-restore --user barman --parallel 8 {{ postgres_barman_server }} {{ postgres_primary.restore_directory }} %f %p'
+{% if postgres_primary.restore_command is defined %}
+restore_command = '{{ postgres_primary.restore_command }}'
+{% elif postgres_primary.restore_barman_directory is defined %}
+restore_command = '/usr/bin/barman-wal-restore --user barman --parallel 8 {{ postgres_barman_server }} {{ postgres_primary.restore_barman_directory }} %f %p'
+{% endif %}
 primary_conninfo = 'host={{ postgres_primary.host }} port={{ postgres_primary.port }} user={{ postgres_primary.replication_user }} password={{ postgres_primary.replication_password }} sslmode=require'
 trigger_file = '/var/lib/postgresql/{{ postgres_version }}/{{ postgres_cluster_name }}/failover.trigger'
 recovery_target_timeline='latest'