2 - name: Compute barman remote URL
4 barman_remote_url: "{{ scheme }}{{ user }}{{ server }}{{ delimiter }}{{ path }}"
5 rsync_options: "{{ postgres_barman_rsync_options | default('') }}{{ rsync_password_file }}"
7 scheme: "{{ postgres_barman_rsync_enabled | ternary('rsync://', '') }}"
8 user: "{{ postgres_barman_remote_user is defined | ternary(postgres_barman_remote_user + '@', '') }}"
9 server: "{{ postgres_barman_server }}"
10 delimiter: "{{ postgres_barman_rsync_enabled | ternary('', ':')}}"
11 path: "{{ postgres_barman_path_prefix | default('~') }}"
12 rsync_password_file: "{{ postgres_barman_rsync_enabled | ternary(' --password-file=/var/lib/postgresql/.rsync_pass ', '') }}"
14 - name: Copy secondary script
15 template: src=standby-clone.sh.j2 dest=/root/standby-clone-{{ postgres_version }}-{{ postgres_cluster_name }}.sh mode=0755
17 - name: Copy rsync password file
19 content: "{{ barman_rsync_password }}"
20 dest: /var/lib/postgresql/.rsync_pass
25 when: postgres_barman_rsync_enabled