formula-prometheus/prometheus/server.sls

31 lines
694 B
Text
Raw Normal View History

{% 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 %}