From 99504fed92577795e1ab0bf2ec0cd30a2435799f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Helleboid?= Date: Thu, 2 May 2019 17:24:20 +0200 Subject: Allow to set options for barman connectivity - Allow to pass arbitrary options - Build the URL in a dedicated step - Allow to specify path prefix for barman files - Add documentation in [README.md](README.md) --- templates/postgresql.10.conf.j2 | 2 +- templates/standby-clone.sh.j2 | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/templates/postgresql.10.conf.j2 b/templates/postgresql.10.conf.j2 index 588020f..b07b22b 100644 --- a/templates/postgresql.10.conf.j2 +++ b/templates/postgresql.10.conf.j2 @@ -228,7 +228,7 @@ wal_log_hints = on # also do full page writes of non-critical updates {% if postgres_archive_enabled %} archive_mode = on -archive_command = 'rsync -a %p barman@{{ postgres_barman_server }}:/var/lib/barman/{{ barman_directory }}/incoming/%f' +archive_command = 'rsync -a %p {{ postgres_barman_remote_user }}@{{ postgres_barman_server }}:/var/lib/barman/{{ barman_directory }}/incoming/%f' {% else %} archive_mode = off archive_command = '' diff --git a/templates/standby-clone.sh.j2 b/templates/standby-clone.sh.j2 index 16a6930..2db44b6 100755 --- a/templates/standby-clone.sh.j2 +++ b/templates/standby-clone.sh.j2 @@ -29,11 +29,8 @@ sudo -u postgres mkdir -p /var/lib/postgresql/{{ postgres_version }}/{{ postgres echo Get previous backup from backups server sudo -u postgres \ - time rsync --progress -pvia --exclude='*.conf' --exclude='server.crt' --exclude='server.key' --delete \ -{% if postgres_barman_rsync_enabled|default(false) -%} - --password-file=/var/lib/postgresql/.rsync_pass \ -{%- endif %} - {% if postgres_barman_rsync_enabled|default(false) -%}rsync://{%- endif -%}barman@{{ postgres_barman_server }}{%- if postgres_barman_rsync_enabled|default(false) -%}/backups{%- else -%}:~{%- endif -%}/$BARMAN_DATABASE/base/$BARMAN_BACKUP_VERSION/data/ \ + time rsync --progress -pvia --exclude='*.conf' --exclude='server.crt' --exclude='server.key' --delete {{ rsync_options }} \ + {{ barman_remote_url }}/$BARMAN_DATABASE/base/$BARMAN_BACKUP_VERSION/data/ \ /var/lib/postgresql/{{ postgres_version }}/{{ postgres_cluster_name }}/ echo Restoring .conf and server certificate -- cgit v1.2.3