From 0315d03cdb1212d20d3c3f57bcc8bc98948a9081 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 17 Jan 2024 07:17:23 +0200 Subject: [PATCH] Make sure prometheus-postgres-exporter is connected to the Postgres network (if necessary) Supersedes https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3110 --- group_vars/matrix_servers | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 3ebe649be..32c65c561 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -4183,7 +4183,12 @@ prometheus_postgres_exporter_hostname: "{{ matrix_server_fqn_matrix }}" prometheus_postgres_exporter_container_network: "{{ matrix_monitoring_container_network }}" -prometheus_postgres_exporter_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else [] }}" +prometheus_postgres_exporter_container_additional_networks: | + {{ + ([devture_postgres_container_network] if (devture_postgres_enabled and prometheus_postgres_exporter_database_hostname == devture_postgres_connection_hostname and prometheus_postgres_exporter_container_network != devture_postgres_container_network) else []) + + + ([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network and prometheus_postgres_exporter_container_labels_traefik_enabled else []) + }} prometheus_postgres_exporter_container_labels_traefik_enabled: "{{ matrix_metrics_exposure_enabled }}" prometheus_postgres_exporter_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"