Skip to content

Commit

Permalink
Use separate *_dsn_attributes settings for PGD CLI and PGD-Proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
gcedb authored and JonathanRenon-EDB committed Sep 26, 2024
1 parent 515b213 commit f2d0af6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 5 additions & 1 deletion roles/init/tasks/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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) }}"

Expand Down
6 changes: 1 addition & 5 deletions roles/pgdcli/config/templates/pgd-cli-config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f2d0af6

Please sign in to comment.