Move the configuration into a separate state

This patch separates the configuration of Grafana client. This allows to
configure the client, restart the minion to read the conf and finally
apply the grafana.client state.
pull/15/head
Guillaume Thouvenin 6 years ago
parent 7e07c93f36
commit 57167d8bfd
  1. 8
      grafana/client/init.sls
  2. 11
      grafana/client/service.sls

@ -1,12 +1,8 @@
{%- from "grafana/map.jinja" import client with context %}
{%- if client.get('enabled', False) %}
/etc/salt/minion.d/_grafana.conf:
file.managed:
- source: salt://grafana/files/_grafana.conf
- template: jinja
- user: root
- group: root
include:
- grafana.client.service
{%- for datasource_name, datasource in client.datasource.iteritems() %}

@ -0,0 +1,11 @@
{%- from "grafana/map.jinja" import client with context %}
{%- if client.get('enabled', False) %}
/etc/salt/minion.d/_grafana.conf:
file.managed:
- source: salt://grafana/files/_grafana.conf
- template: jinja
- user: root
- group: root
{%- endif %}
Loading…
Cancel
Save