diff --git a/roles/init/tasks/postgres.yml b/roles/init/tasks/postgres.yml index 47b631bee..0f46ee26e 100644 --- a/roles/init/tasks/postgres.yml +++ b/roles/init/tasks/postgres.yml @@ -516,6 +516,8 @@ repmgr_client_dsn_attributes: "{{ repmgr_client_dsn_attributes|default('') }}" bdr_client_dsn_attributes: "{{ bdr_client_dsn_attributes|default('') }}" harp_dcs_client_dsn_attributes: "{{ harp_dcs_client_dsn_attributes|default('') }}" + pgd_proxy_dsn_attributes: "{{ pgd_proxy_dsn_attributes|default('') }}" + pgd_cli_dsn_attributes: "{{ pgd_cli_dsn_attributes|default('') }}" - name: Set default DSNs set_fact: @@ -530,13 +532,15 @@ bdr_node_dsn: >- host={{ inventory_hostname }} port={{ postgres_port }} dbname={{ bdr_database }} user={{ postgres_user }} {{ bdr_client_dsn_attributes }} bdr_node_route_dsn: >- - host={{ inventory_hostname }} port={{ postgres_port }} dbname={{ bdr_database }} user={{ pgd_proxy_user }} {{ bdr_client_dsn_attributes }} + host={{ inventory_hostname }} port={{ postgres_port }} dbname={{ bdr_database }} user={{ pgd_proxy_user }} {{ pgd_proxy_dsn_attributes }} bdr_node_local_dsn: >- host={{ unix_socket_directories|first }} port={{ postgres_port }} dbname={{ bdr_database }} user={{ harp_manager_user }} pgbouncer_node_dsn: >- host={{ inventory_hostname }} port={{ pgbouncer_port }} harp_dcs_node_dsn: >- host={{ inventory_hostname }} port={{ postgres_port }} user={{ postgres_user }} {{ harp_dcs_client_dsn_attributes }} + pgd_cli_dsn: >- + host={{ inventory_hostname }} port={{ postgres_port }} dbname={{ bdr_database }} user={{ postgres_user }} {{ pgd_cli_dsn_attributes }} vars: _repmgr_hostname: "{{ repmgr_hostname|default(inventory_hostname) }}" diff --git a/roles/pgdcli/config/templates/pgd-cli-config.j2 b/roles/pgdcli/config/templates/pgd-cli-config.j2 index 84dc722b1..c40d4e43e 100644 --- a/roles/pgdcli/config/templates/pgd-cli-config.j2 +++ b/roles/pgdcli/config/templates/pgd-cli-config.j2 @@ -3,11 +3,7 @@ cluster: endpoints: {% for h in groups[bdr_node_group] %} {% set v = hostvars[h] %} -{% if 'bdr' in role %} - - "{{ v.bdr_node_dsn }}" -{% elif 'pgd-proxy' in role %} - - "{{ v.bdr_node_route_dsn }}" -{% endif %} + - "{{ v.pgd_cli_dsn }}" {% endfor %} {% if bdr_version is version('5', '>=') and pgd_ssl_password_command|default(None) %} ssl: