From 28a26dde4e511d47fc73a273baae39b9021755aa Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 17 Jan 2024 16:57:06 +0200 Subject: [PATCH] Make it safer to reference variables from alternative homeserver implementations This allows people to not include the `matrix-conduit` or `matrix-dendrite` roles in their custom playbook (based on our roles) and still not have the playbook choke on variables from these roles missing. For getting rid of the `matrix-synapse` role in a similar way, more work is likely necessary. --- group_vars/matrix_servers | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index d9456a3e8..1354a5aed 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -471,18 +471,18 @@ matrix_homeserver_systemd_services_list: |- matrix_homeserver_container_client_api_endpoint: |- {{ { - 'synapse': ('matrix-synapse-reverse-proxy-companion:8008' if matrix_synapse_reverse_proxy_companion_enabled else 'matrix-synapse:'+ matrix_synapse_container_client_api_port|string), - 'dendrite': ('matrix-dendrite:' + matrix_dendrite_http_bind_port|string), - 'conduit': ('matrix-conduit:' + matrix_conduit_port_number|string), + 'synapse': ('matrix-synapse-reverse-proxy-companion:8008' if matrix_synapse_reverse_proxy_companion_enabled | default(false) else ('matrix-synapse:'+ matrix_synapse_container_client_api_port | default('8008') | string)), + 'dendrite': ('matrix-dendrite:' + matrix_dendrite_http_bind_port | default('8008') | string), + 'conduit': ('matrix-conduit:' + matrix_conduit_port_number | default('8008') | string), }[matrix_homeserver_implementation] }} matrix_homeserver_container_federation_api_endpoint: |- {{ { - 'synapse': ('matrix-synapse-reverse-proxy-companion:8048' if matrix_synapse_reverse_proxy_companion_enabled else 'matrix-synapse:'+ matrix_synapse_container_federation_api_plain_port|string), - 'dendrite': ('matrix-dendrite:' + matrix_dendrite_http_bind_port|string), - 'conduit': ('matrix-conduit:' + matrix_conduit_port_number|string), + 'synapse': ('matrix-synapse-reverse-proxy-companion:8048' if matrix_synapse_reverse_proxy_companion_enabled else ('matrix-synapse:'+ matrix_synapse_container_federation_api_plain_port | default('8008') | string)), + 'dendrite': ('matrix-dendrite:' + matrix_dendrite_http_bind_port | default('8008') | string), + 'conduit': ('matrix-conduit:' + matrix_conduit_port_number | default('8008') | string), }[matrix_homeserver_implementation] }} @@ -2152,8 +2152,8 @@ matrix_bot_maubot_homeserver_url: "{{ matrix_addons_homeserver_client_api_url }} matrix_bot_maubot_homeserver_secret: |- {{ { - 'synapse': matrix_synapse_registration_shared_secret, - 'dendrite': matrix_dendrite_client_api_registration_shared_secret, + 'synapse': matrix_synapse_registration_shared_secret | default(''), + 'dendrite': matrix_dendrite_client_api_registration_shared_secret | default(''), }[matrix_homeserver_implementation] }} @@ -4485,8 +4485,8 @@ matrix_registration_riot_instance: "{{ ('https://' + matrix_server_fqn_element) matrix_registration_shared_secret: |- {{ { - 'synapse': matrix_synapse_registration_shared_secret, - 'dendrite': matrix_dendrite_client_api_registration_shared_secret, + 'synapse': matrix_synapse_registration_shared_secret | default (''), + 'dendrite': matrix_dendrite_client_api_registration_shared_secret | default (''), 'conduit': '', }[matrix_homeserver_implementation] }}