From bbb58c40b66ac14a4630963662401031b9147a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Fri, 27 Dec 2024 17:21:31 +0100 Subject: [PATCH] Fix docker networking when no reverse-proxy is used For example, synapse-admin connects to additional networks here: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/c0559870b50ad9e3848533c10066f985ff4b3ae0/roles/custom/matrix-synapse-admin/templates/systemd/matrix-synapse-admin.service.j2#L39-L41 This defaults to 'traefik' through matrix_playbook_reverse_proxy_container_network, which is not correct in case matrix_playbook_reverse_proxy_type is set to none. --- group_vars/matrix_servers | 2 +- roles/custom/matrix-base/defaults/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 85e8a8717..a46140347 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -32,7 +32,7 @@ matrix_playbook_docker_installation_daemon_options_custom: {} # yet still use Traefik installed in another way. matrix_playbook_traefik_labels_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" -matrix_playbook_reverse_proxy_container_network: "{{ traefik_container_network if traefik_enabled else 'traefik' }}" +matrix_playbook_reverse_proxy_container_network: "{{ traefik_container_network if traefik_enabled else 'traefik' if matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] else '' }}" matrix_playbook_reverse_proxy_hostname: "{{ traefik_identifier if traefik_enabled else 'traefik' }}" matrix_playbook_reverse_proxy_traefik_middleware_compression_enabled: "{{ traefik_config_http_middlewares_compression_enabled if (traefik_enabled and traefik_config_http_middlewares_compression_enabled) else false }}" diff --git a/roles/custom/matrix-base/defaults/main.yml b/roles/custom/matrix-base/defaults/main.yml index 076cb8006..a0dd2f04d 100644 --- a/roles/custom/matrix-base/defaults/main.yml +++ b/roles/custom/matrix-base/defaults/main.yml @@ -234,7 +234,7 @@ matrix_metrics_exposure_http_basic_auth_users: '' matrix_playbook_reverse_proxy_type: '' # Specifies the network that the reverse-proxy is operating at -matrix_playbook_reverse_proxy_container_network: 'traefik' +matrix_playbook_reverse_proxy_container_network: "{{ 'traefik' if matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] else '' }}" # Specifies the hostname that the reverse-proxy is available at matrix_playbook_reverse_proxy_hostname: 'matrix-traefik'