1
0
Fork 0
mirror of synced 2024-11-19 07:35:34 -05:00
formula-grafana/grafana/server.sls
Guillaume Thouvenin 70ca667e57 Add default dashboards for StackLight
This patch adds the possibility to add StackLight dashboards when
installing grafana. By default they are not installed.
2016-10-26 11:25:37 +02:00

39 lines
848 B
Text

{%- from "grafana/map.jinja" import server with context %}
{%- if server.enabled %}
grafana_packages:
pkg.installed:
- names: {{ server.pkgs }}
/etc/grafana/grafana.ini:
file.managed:
- source: salt://grafana/files/grafana.ini
- template: jinja
- user: grafana
- group: grafana
- require:
- pkg: grafana_packages
{%- if server.dashboards.enabled %}
grafana_copy_default_dashboards:
file.recurse:
- name: {{ server.dashboards.path }}
- source: salt://grafana/files/dashboards
- user: grafana
- group: grafana
- require:
- pkg: grafana_packages
{%- endif %}
grafana_service:
service.running:
- name: {{ server.service }}
- enable: true
- watch:
- file: /etc/grafana/grafana.ini
{%- if server.dashboards.enabled %}
- require:
- file: grafana_copy_default_dashboards
{%- endif %}
{%- endif %}