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) --- tasks/postgres-standby-barman.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tasks') diff --git a/tasks/postgres-standby-barman.yml b/tasks/postgres-standby-barman.yml index 65e87a6..6a94b75 100644 --- a/tasks/postgres-standby-barman.yml +++ b/tasks/postgres-standby-barman.yml @@ -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 -- cgit v1.2.3