prometheus-formula/prometheus/config/environ.sls

29 lines
875 B
Plaintext
Raw Normal View History

# -*- coding: utf-8 -*-
# vim: ft=sls
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import prometheus with context %}
{%- set sls_archive_install = tplroot ~ '.archive.install' %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
include:
- {{ sls_archive_install }}
prometheus-config-file-file-managed-environ_file:
file.managed:
- name: {{ prometheus.environ_file }}
- source: {{ files_switch(['prometheus.sh.jinja'],
lookup='prometheus-config-file-file-managed-environ_file'
)
}}
- mode: 644
- user: root
- group: {{ prometheus.rootgroup }}
- makedirs: True
- template: jinja
- context:
prometheus: {{ prometheus|json }}
- require:
- sls: {{ sls_archive_install }}