summaryrefslogtreecommitdiffstats
path: root/roles/grafana
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-06-22 18:04:40 +0200
committerAhmed Abdelhalim <[email protected]>2026-06-22 18:04:40 +0200
commit1a7d06d83d41b343a48c181cb47c4c9974a5626a (patch)
tree6df05c0a11d41a419d261bcd8a052de19172c2f6 /roles/grafana
parentded892e34378c3675717384decebbf87e3f70039 (diff)
Refactor installing grafana dashboards using URL only
Refactor prometheus extra scraping jobs
Diffstat (limited to 'roles/grafana')
-rw-r--r--roles/grafana/meta/argument_specs.yml14
-rw-r--r--roles/grafana/tasks/main.yml6
2 files changed, 8 insertions, 12 deletions
diff --git a/roles/grafana/meta/argument_specs.yml b/roles/grafana/meta/argument_specs.yml
index 5a38b97d..c9d53bb1 100644
--- a/roles/grafana/meta/argument_specs.yml
+++ b/roles/grafana/meta/argument_specs.yml
@@ -53,23 +53,19 @@ argument_specs:
description: "FQDN for the grafana nginx vhost (e.g. 'monitor.home.arpa')."
default: "monitor.home.arpa"
grafana_dashboards:
- description: "List of community dashboards to download and provision"
+ description: "List of dashboards to download and provision"
type: "list"
elements: "dict"
default: []
options:
- id:
- description: "Grafana.com dashboard ID"
- type: "int"
- required: true
- revision:
- description: "Dashboard revision number"
- type: "int"
- required: true
name:
description: "Local name for the dashboard file"
type: "str"
required: true
+ url:
+ description: "URL to download the dashboard JSON from"
+ type: "str"
+ required: true
datasource_mappings:
description: "List of datasource variable mappings for the dashboard"
type: "list"
diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml
index f7b7d851..088d61c7 100644
--- a/roles/grafana/tasks/main.yml
+++ b/roles/grafana/tasks/main.yml
@@ -53,7 +53,7 @@
notify: "Restart grafana"
no_log: true
-- name: "Provision Grafana community dashboards"
+- name: "Provision Grafana dashboards"
notify: "Restart grafana"
# grafana downloaded dashboards are being rewritten after successful download
# this is to correct the datasource mapping in the downloaded files
@@ -61,10 +61,10 @@
tags:
- molecule-idempotence-notest
block:
- - name: "Download Grafana community dashboards"
+ - name: "Download Grafana dashboards"
become: true
ansible.builtin.get_url:
- url: "https://grafana.com/api/dashboards/{{ item.id }}/revisions/{{ item.revision }}/download"
+ url: "{{ item.url }}"
dest: "/etc/grafana/provisioning/dashboards/{{ item.name }}.json"
owner: "grafana"
group: "grafana"