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

@ -68,7 +68,7 @@
mode: 0440
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
with_items: "{{ matrix_grafana_dashboard_download_urls_all }}"
with_items: "{{ matrix_grafana_dashboard_download_urls }}"
when: matrix_grafana_enabled | bool
register: result
retries: "{{ matrix_geturl_retries_count }}"

View File

@ -5,3 +5,12 @@
msg: >
You need to enable `matrix_prometheus_enabled` to use Prometheus as data source for Grafana.
when: "not matrix_prometheus_enabled"
- name: (Deprecation) Catch and report renamed settings
ansible.builtin.fail:
msg: >-
Your configuration contains a variable, which now has a different name.
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
when: "item.old in vars"
with_items:
- {'old': 'matrix_grafana_dashboard_download_urls_all', 'new': 'matrix_grafana_dashboard_download_urls'}