Merge "Extend support for custom Grafana dashboards"

This commit is contained in:
Zuul 2021-07-12 16:00:47 +00:00 committed by Gerrit Code Review
commit 6ea8390a12
2 changed files with 7 additions and 21 deletions

View File

@ -139,26 +139,12 @@
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Create custom Grafana dashboards folder
become: true
vars:
service: "{{ grafana_services['grafana'] }}"
file:
dest: "{{ node_config_directory }}/grafana/dashboards/"
state: "directory"
mode: "0770"
when:
- grafana_custom_dashboards_folder.stat.exists
- grafana_custom_dashboards_folder.stat.isdir
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Copying over custom dashboards
vars:
service: "{{ grafana_services['grafana'] }}"
copy:
src: "{{ item }}"
dest: "{{ node_config_directory }}/grafana/dashboards/"
src: "{{ node_custom_config }}/grafana/dashboards"
dest: "{{ node_config_directory }}/grafana/"
mode: "0660"
become: true
when:
@ -166,7 +152,5 @@
- grafana_custom_dashboards_folder.stat.isdir
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_fileglob:
- "{{ node_custom_config }}/grafana/dashboards/*.json"
notify:
- Restart grafana container

View File

@ -35,9 +35,11 @@ Custom dashboards provisioning
Kolla Ansible sets custom dashboards provisioning using `Dashboard provider <https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards>`_.
Dashboard's JSON files should be placed into
``{{ node_custom_config }}/grafana/dashboards/`` folder.
Dashboards will be imported to Grafana dashboards General Folder.
Dashboard JSON files should be placed into the
``{{ node_custom_config }}/grafana/dashboards/`` folder. The use of
sub-folders is also supported when using a custom ``provisioning.yaml``
file. Dashboards will be imported into the Grafana dashboards 'General'
folder by default.
Grafana provisioner config can be altered by placing ``provisioning.yaml`` to
``{{ node_custom_config }}/grafana/`` folder.