grafana: explicitly validate graphs

Explicitly validate the graphs early to avoid doing anything if the
graphs won't load.

Change-Id: Ie9e858e4d8ce92e72de4358fecc40196f79b0229
This commit is contained in:
Ian Wienand 2022-08-03 14:57:31 +10:00
parent 8d15ae16d9
commit 78f01dc19e
1 changed files with 20 additions and 11 deletions

View File

@ -11,17 +11,6 @@
include_role:
name: use-buildset-registry
- name: install pip
include_role:
name: ensure-pip
- name: Install dependencies
package:
name:
- python3-docker
state: present
become: yes
- name: Make environment vars
set_fact:
SECRETS_DIR: '{{ ansible_user_dir }}/grafana-secrets'
@ -35,6 +24,26 @@
# config file or something some other time.
SCREENSHOT_HEIGHT: '5000'
# Initial sanity check
- name: Explicitly validate dashboards
shell:
executable: /bin/bash
cmd: |
docker run --rm -t -v {{ GRAFYAML_DIR }}:/grafana:ro \
--entrypoint /usr/local/bin/grafana-dashboard \
opendevorg/grafyaml --debug validate /grafana
- name: install pip
include_role:
name: ensure-pip
- name: Install dependencies
package:
name:
- python3-docker
state: present
become: yes
- name: Setup test environment
shell:
executable: /bin/bash