]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blobdiff - tasks/postgres-standby-barman.yml
Allow to set options for barman connectivity
[github/fretlink/ansible-postgresql-role.git] / tasks / postgres-standby-barman.yml
index 65e87a6f87edc2d324e3cc076428dbe15e691e13..6a94b755d6fd77073c3a6bff4d0c10967f311dc0 100644 (file)
@@ -1,4 +1,16 @@
 ---
+- name: Compute barman remote URL
+  set_fact:
+    barman_remote_url: "{{ scheme }}{{ user }}{{ server }}{{ delimiter }}{{ path }}"
+    rsync_options: "{{ postgres_barman_rsync_options | default('') }}{{ rsync_password_file }}"
+  vars:
+    scheme: "{{ postgres_barman_rsync_enabled | ternary('rsync://', '') }}"
+    user: "{{ postgres_barman_remote_user is defined | ternary(postgres_barman_remote_user + '@', '') }}"
+    server: "{{ postgres_barman_server }}"
+    delimiter: "{{ postgres_barman_rsync_enabled | ternary('', ':')}}"
+    path: "{{ postgres_barman_path_prefix | default('~') }}"
+    rsync_password_file: "{{ postgres_barman_rsync_enabled | ternary(' --password-file=/var/lib/postgresql/.rsync_pass ', '') }}"
+
 - name: Copy secondary script
   template: src=standby-clone.sh.j2 dest=/root/standby-clone-{{ postgres_version }}-{{ postgres_cluster_name }}.sh mode=0755