1
0
Fork 0
mirror of synced 2024-07-13 12:29:58 -04:00

Manage minion.d using support metadata

Change-Id: I37f1c26f8125d98bcbe8d5a105dd5abac9224b36
This commit is contained in:
Filip Pytloun 2017-05-03 15:10:41 +02:00
parent 4931237ebc
commit 67a022be4f
4 changed files with 16 additions and 27 deletions

View file

@ -1,9 +1,6 @@
{%- from "grafana/map.jinja" import client with context %}
{%- if client.get('enabled', False) %}
include:
- grafana.client.service
{%- for datasource_name, datasource in client.datasource.iteritems() %}
grafana_client_datasource_{{ datasource_name }}:

View file

@ -1,11 +0,0 @@
{%- 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 %}

View file

@ -1,13 +0,0 @@
{%- from "grafana/map.jinja" import client with context %}
grafana_version: {{ client.server.get('version', 3) }}
grafana:
grafana_timeout: 3
{%- if client.server.token is defined %}
grafana_token: {{ client.server.token }}
{%- else %}
grafana_user: {{ client.server.user }}
grafana_password: {{ client.server.password }}
{%- endif %}
grafana_url: '{{ client.server.get('protocol', 'http') }}://{{ client.server.host }}:{{ client.server.get('port', 80) }}'

View file

@ -14,3 +14,19 @@ grain:
{{ service_grains|yaml(False)|indent(4) }}
{%- endif %}
{%- endif %}
minion:
{%- if pillar.grafana.client is defined %}
grafana:
{%- from "grafana/map.jinja" import client with context %}
grafana_version: {{ client.server.get('version', 3) }}
grafana:
grafana_timeout: 3
{%- if client.server.token is defined %}
grafana_token: {{ client.server.token }}
{%- else %}
grafana_user: {{ client.server.user }}
grafana_password: {{ client.server.password }}
{%- endif %}
grafana_url: '{{ client.server.get('protocol', 'http') }}://{{ client.server.host }}:{{ client.server.get('port', 80) }}'
{%- endif %}