2017-03-09 06:12:27 -05:00
|
|
|
{% from "prometheus/map.jinja" import alertmanager with context %}
|
|
|
|
{%- if alertmanager.enabled %}
|
|
|
|
|
2017-05-09 03:45:44 -04:00
|
|
|
{%- if pillar.docker is defined and pillar.docker.host is defined %}
|
2017-03-09 06:12:27 -05:00
|
|
|
|
2017-05-17 10:00:52 -04:00
|
|
|
{{alertmanager.dir.config}}:
|
|
|
|
file.directory:
|
|
|
|
- makedirs: True
|
|
|
|
|
|
|
|
# prometheus user is available inside docker container not on docker host
|
|
|
|
# in dockerfile for alertmanager we ensure that it will have 999 uid
|
|
|
|
{{alertmanager.dir.data}}:
|
|
|
|
file.directory:
|
|
|
|
- makedirs: True
|
|
|
|
- mode: 755
|
|
|
|
- user: {{alertmanager.user}}
|
|
|
|
|
2017-03-09 06:12:27 -05:00
|
|
|
{{alertmanager.dir.config}}/alertmanager.yml:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://prometheus/files/alertmanager.yml
|
|
|
|
- template: jinja
|
2017-05-17 10:00:52 -04:00
|
|
|
- require:
|
|
|
|
- file: {{alertmanager.dir.config}}
|
2017-03-09 06:12:27 -05:00
|
|
|
|
|
|
|
{%- endif %}
|
|
|
|
{%- endif %}
|