aboutsummaryrefslogtreecommitdiffstats
path: root/roles/grafana/templates/datasources-default.yml.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/grafana/templates/datasources-default.yml.j2')
-rw-r--r--roles/grafana/templates/datasources-default.yml.j212
1 files changed, 12 insertions, 0 deletions
diff --git a/roles/grafana/templates/datasources-default.yml.j2 b/roles/grafana/templates/datasources-default.yml.j2
new file mode 100644
index 0000000..1414ff2
--- /dev/null
+++ b/roles/grafana/templates/datasources-default.yml.j2
@@ -0,0 +1,12 @@
+# managed by Ansible
+{% import 'macros.j2' as macros with context %}
+
+apiVersion: 1
+
+datasources:
+{% call(h) macros.loop_valid_hosts("servers") %}
+ - name: {{ h.inventory_hostname }}-prometheus
+ type: prometheus
+ url: http://{{ h.__ip.internal }}:9090
+
+{% endcall %}
remember that computers suck.