2019-06-08 19:39:21 +02:00
|
|
|
# -*- 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' %}
|
2019-06-16 02:33:24 +02:00
|
|
|
{%- set sls_package_install = tplroot ~ '.package.install' %}
|
2019-06-08 19:39:21 +02:00
|
|
|
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
|
|
|
|
|
|
|
|
include:
|
2019-06-16 02:33:24 +02:00
|
|
|
- {{ sls_archive_install if prometheus.pkg.use_upstream_archive else sls_package_install }}
|
2019-06-08 19:39:21 +02:00
|
|
|
|
|
|
|
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:
|
2019-06-16 02:33:24 +02:00
|
|
|
- sls: {{ sls_archive_install if prometheus.pkg.use_upstream_archive else sls_package_install }}
|