1
0
Fork 0
mirror of synced 2024-11-19 07:35:34 -05:00
formula-grafana/grafana/server.sls

40 lines
848 B
Text
Raw Normal View History

2015-12-04 10:43:48 -05:00
{%- from "grafana/map.jinja" import server with context %}
{%- if server.enabled %}
grafana_packages:
pkg.installed:
2015-12-08 04:23:39 -05:00
- names: {{ server.pkgs }}
2015-12-04 10:43:48 -05:00
2015-12-08 04:23:39 -05:00
/etc/grafana/grafana.ini:
2015-12-04 10:43:48 -05:00
file.managed:
2015-12-08 04:23:39 -05:00
- source: salt://grafana/files/grafana.ini
2015-12-04 10:43:48 -05:00
- template: jinja
2015-12-08 05:23:30 -05:00
- user: grafana
- group: grafana
2015-12-04 10:43:48 -05:00
- 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 %}
2015-12-08 04:26:39 -05:00
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 %}
2015-12-08 04:26:39 -05:00
{%- endif %}