Skip to content

Commit

Permalink
force pgbackrest template config file name
Browse files Browse the repository at this point in the history
When using the same server for both primary and pgbackrestserver roles,
pgbackrest role will fail with following error :
Could not find or access
'./templates/pgbackrest_pgbackrestserver.async.conf.template'

This is due to server belonging to both 'pgbackrestserver' and 'primary'
inventory groups.
  • Loading branch information
aya authored and vibhorkumar123 committed Feb 26, 2024
1 parent b13321b commit bd1468c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roles/setup_pgbackrest/tasks/configure_pgbackrest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

- name: Build configuration file {{ pgbackrest_configuration_file }}
ansible.builtin.template:
src: "./templates/pgbackrest_{{ group_names[0] }}.{{ pgbackrest_archive_method }}.conf.template"
src: "./templates/pgbackrest_{{ group_names |select('match', 'primary|slave') |first }}.{{ pgbackrest_archive_method }}.conf.template"
dest: "{{ pgbackrest_configuration_file }}"
owner: "{{ pg_owner }}"
group: "{{ pg_group }}"
Expand Down

0 comments on commit bd1468c

Please sign in to comment.