Skip to content

Commit 2a28e99

Browse files
authored
Merge pull request #145 from stackhpc/feature/dashboard_folders
Extend support for custom Grafana dashboards
2 parents e2f9cab + 8998fc5 commit 2a28e99

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

ansible/roles/grafana/tasks/config.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,34 +139,18 @@
139139
- inventory_hostname in groups[service.group]
140140
- service.enabled | bool
141141

142-
- name: Create custom Grafana dashboards folder
143-
become: true
144-
vars:
145-
service: "{{ grafana_services['grafana'] }}"
146-
file:
147-
dest: "{{ node_config_directory }}/grafana/dashboards/"
148-
state: "directory"
149-
mode: "0770"
150-
when:
151-
- grafana_custom_dashboards_folder.stat.exists
152-
- grafana_custom_dashboards_folder.stat.isdir
153-
- inventory_hostname in groups[service.group]
154-
- service.enabled | bool
155-
156142
- name: Copying over custom dashboards
157143
vars:
158144
service: "{{ grafana_services['grafana'] }}"
159145
copy:
160-
src: "{{ item }}"
161-
dest: "{{ node_config_directory }}/grafana/dashboards/"
146+
src: "{{ node_custom_config }}/grafana/dashboards"
147+
dest: "{{ node_config_directory }}/grafana/"
162148
mode: "0660"
163149
become: true
164150
when:
165151
- grafana_custom_dashboards_folder.stat.exists
166152
- grafana_custom_dashboards_folder.stat.isdir
167153
- inventory_hostname in groups[service.group]
168154
- service.enabled | bool
169-
with_fileglob:
170-
- "{{ node_custom_config }}/grafana/dashboards/*.json"
171155
notify:
172156
- Restart grafana container

doc/source/reference/logging-and-monitoring/grafana-guide.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ Custom Dashboards Provisioning
3535

3636
Kolla Ansible sets Custom Dashboards Provisioning using `Dashboard provider <https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards>`_.
3737

38-
Dashboard's JSON files should be placed into
39-
``{{ node_custom_config }}/grafana/dashboards/`` folder.
40-
Dashboards will be imported to Grafana dashboards General Folder.
38+
Dashboard JSON files should be placed into the
39+
``{{ node_custom_config }}/grafana/dashboards/`` folder. The use of
40+
sub-folders if also supported when using a custom ``provisioning.yaml``
41+
file. Dashboards will be imported into the Grafana dashboards 'General'
42+
folder by default.
4143

4244
Grafana provisioner config can be altered by placing ``provisioning.yaml`` to
4345
``{{ node_custom_config }}/grafana/`` folder.

0 commit comments

Comments
 (0)