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

Commit

Permalink
Use fileglob for registering local dashboard files (#197)
Browse files Browse the repository at this point in the history
[patch] release
  • Loading branch information
paulfantom authored Jan 13, 2020
1 parent cb126c2 commit 7b06069
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,17 @@
- grafana_notifications
- grafana_run

- name: "Check if there are any dashboards in {{ grafana_dashboards_dir }}"
- name: "Check if there are any dashboards in local {{ grafana_dashboards_dir }}"
become: false
find:
paths: "{{ grafana_dashboards_dir }}"
patterns: '*.json'
delegate_to: localhost
run_once: true
register: found_dashboards
set_fact:
found_dashboards: "{{ lookup('fileglob', grafana_dashboards_dir + '/*.json', wantlist=True) }}"
tags:
- grafana_configure
- grafana_dashboards
- grafana_run

- include: dashboards.yml
when: grafana_dashboards | length > 0 or found_dashboards.matched > 0
when: grafana_dashboards | length > 0 or found_dashboards | length > 0
tags:
- grafana_configure
- grafana_dashboards
Expand Down

0 comments on commit 7b06069

Please sign in to comment.