2019-04-24 18:18:44 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{%- set sls_config_file = tplroot ~ '.config.file' %}
|
|
|
|
{%- from tplroot ~ "/map.jinja" import prometheus with context %}
|
|
|
|
|
|
|
|
include:
|
|
|
|
- {{ sls_config_file }}
|
|
|
|
|
|
|
|
{%- if prometheus.service.sysrc %}
|
|
|
|
prometheus_args:
|
|
|
|
sysrc.managed:
|
2019-04-26 13:09:09 +02:00
|
|
|
# service prometheus restart tended to hang on FreeBSD
|
|
|
|
# https://github.com/saltstack/salt/issues/44848#issuecomment-487016414
|
|
|
|
- value: "{{ prometheus.service.flags }} >/dev/null 2>&1"
|
2019-04-24 18:18:44 +02:00
|
|
|
{%- endif %}
|
|
|
|
|
|
|
|
prometheus-service-running-service-running:
|
|
|
|
service.running:
|
|
|
|
- name: {{ prometheus.service.name }}
|
|
|
|
- enable: True
|
|
|
|
- watch:
|
|
|
|
- file: prometheus-config-file-file-managed
|
|
|
|
{%- if prometheus.service.sysrc %}
|
|
|
|
- sysrc: prometheus_args
|
|
|
|
{%- endif %}
|
|
|
|
- require:
|
|
|
|
- sls: {{ sls_config_file }}
|