Skip to content
This repository was archived by the owner on May 31, 2023. It is now read-only.

Commit 7b06069

Browse files
authored
Use fileglob for registering local dashboard files (#197)
[patch] release
1 parent cb126c2 commit 7b06069

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

tasks/main.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,17 @@
9292
- grafana_notifications
9393
- grafana_run
9494

95-
- name: "Check if there are any dashboards in {{ grafana_dashboards_dir }}"
95+
- name: "Check if there are any dashboards in local {{ grafana_dashboards_dir }}"
9696
become: false
97-
find:
98-
paths: "{{ grafana_dashboards_dir }}"
99-
patterns: '*.json'
100-
delegate_to: localhost
101-
run_once: true
102-
register: found_dashboards
97+
set_fact:
98+
found_dashboards: "{{ lookup('fileglob', grafana_dashboards_dir + '/*.json', wantlist=True) }}"
10399
tags:
104100
- grafana_configure
105101
- grafana_dashboards
106102
- grafana_run
107103

108104
- include: dashboards.yml
109-
when: grafana_dashboards | length > 0 or found_dashboards.matched > 0
105+
when: grafana_dashboards | length > 0 or found_dashboards | length > 0
110106
tags:
111107
- grafana_configure
112108
- grafana_dashboards

0 commit comments

Comments
 (0)