aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorThéophile Helleboid <theophile.helleboid@captaintrain.com>2019-05-02 17:24:20 +0200
committerThéophile Helleboid <theophile.helleboid@captaintrain.com>2019-05-03 14:10:05 +0200
commit99504fed92577795e1ab0bf2ec0cd30a2435799f (patch)
tree4416f99a827f63e37ab98d94c66126d33ab323b0 /templates
parentc6719a82860c7855fb749f98734fe17c38c2fe78 (diff)
downloadansible-postgresql-role-99504fed92577795e1ab0bf2ec0cd30a2435799f.tar.gz
ansible-postgresql-role-99504fed92577795e1ab0bf2ec0cd30a2435799f.tar.zst
ansible-postgresql-role-99504fed92577795e1ab0bf2ec0cd30a2435799f.zip
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)
Diffstat (limited to 'templates')
-rw-r--r--templates/postgresql.10.conf.j22
-rwxr-xr-xtemplates/standby-clone.sh.j27
2 files changed, 3 insertions, 6 deletions
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
228 228
229{% if postgres_archive_enabled %} 229{% if postgres_archive_enabled %}
230archive_mode = on 230archive_mode = on
231archive_command = 'rsync -a %p barman@{{ postgres_barman_server }}:/var/lib/barman/{{ barman_directory }}/incoming/%f' 231archive_command = 'rsync -a %p {{ postgres_barman_remote_user }}@{{ postgres_barman_server }}:/var/lib/barman/{{ barman_directory }}/incoming/%f'
232{% else %} 232{% else %}
233archive_mode = off 233archive_mode = off
234archive_command = '' 234archive_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
29 29
30echo Get previous backup from backups server 30echo Get previous backup from backups server
31sudo -u postgres \ 31sudo -u postgres \
32 time rsync --progress -pvia --exclude='*.conf' --exclude='server.crt' --exclude='server.key' --delete \ 32 time rsync --progress -pvia --exclude='*.conf' --exclude='server.crt' --exclude='server.key' --delete {{ rsync_options }} \
33{% if postgres_barman_rsync_enabled|default(false) -%} 33 {{ barman_remote_url }}/$BARMAN_DATABASE/base/$BARMAN_BACKUP_VERSION/data/ \
34 --password-file=/var/lib/postgresql/.rsync_pass \
35{%- endif %}
36 {% 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/ \
37 /var/lib/postgresql/{{ postgres_version }}/{{ postgres_cluster_name }}/ 34 /var/lib/postgresql/{{ postgres_version }}/{{ postgres_cluster_name }}/
38 35
39echo Restoring .conf and server certificate 36echo Restoring .conf and server certificate