formula-prometheus/prometheus/server.sls
Bartosz Kupidura 8bdf3ed090 Add support for prometheus 2.0
New version changes:
* different alerts format
* rewritten storage (some config flags removed)

Closes-Bug: PROD-16609
Change-Id: I805fa322e4744e98177d6c3e29589ebc6fb917a2
2018-01-03 12:26:10 +01:00

30 lines
694 B
Text

{% from "prometheus/map.jinja" import server with context %}
{%- if server.enabled %}
{%- if pillar.docker is defined and pillar.docker.host is defined %}
{{server.dir.config}}:
file.directory:
- makedirs: True
{{server.dir.data}}:
file.directory:
- makedirs: True
- mode: 755
{{server.dir.config}}/prometheus.yml:
file.managed:
- source: salt://prometheus/files/server/prometheus.yml
- template: jinja
- require:
- file: {{server.dir.config}}
{{server.dir.config}}/alerts.yml:
file.managed:
- source: salt://prometheus/files/server/{{server.version}}/alerts.yml
- template: jinja
- require:
- file: {{server.dir.config}}
{%- endif %}
{%- endif %}