Only download Grafana dashboard URLs for enabled services

If someone is using Dendrite and enabling Grafana, we'll no longer
download Synapse dashboards.

If someone is not using node-exporter, we'll no longer download node
exporter dashboards.

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/2133
This commit is contained in:
Slavi Pantaleev
2022-09-26 08:46:10 +03:00
parent 3f4bedb31e
commit f623cf3550
7 changed files with 28 additions and 13 deletions

View File

@ -9,16 +9,8 @@ matrix_grafana_version: 9.1.6
matrix_grafana_docker_image: "{{ matrix_container_global_registry_prefix }}grafana/grafana:{{ matrix_grafana_version }}"
matrix_grafana_docker_image_force_pull: "{{ matrix_grafana_docker_image.endswith(':latest') }}"
# Not conditional, because when someone disables metrics
# they might still want to look at the old existing data.
# So it would be silly to delete the dashboard in such case.
matrix_grafana_dashboard_download_urls:
- "https://raw.githubusercontent.com/matrix-org/synapse/master/contrib/grafana/synapse.json"
- "https://raw.githubusercontent.com/rfrail3/grafana-dashboards/master/prometheus/node-exporter-full.json"
# matrix_grafana_dashboard_download_urls_all contains the full list (of URLs) of dashboards to download.
# This variable is overriden elsewhere and additional URLs are injected into it (besides those seen in `matrix_grafana_dashboard_download_urls`) based on the enabled components.
matrix_grafana_dashboard_download_urls_all: "{{ matrix_grafana_dashboard_download_urls }}"
# matrix_grafana_dashboard_download_urls holds a list of URLs of dashboards to download
matrix_grafana_dashboard_download_urls: []
matrix_grafana_base_path: "{{ matrix_base_data_path }}/grafana"
matrix_grafana_config_path: "{{ matrix_grafana_base_path }}/config"