2019-06-06 22:15:54 +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 %}
|
|
|
|
|
2019-06-22 19:19:41 +02:00
|
|
|
{%- for name in prometheus.wanted %}
|
|
|
|
{%- if name in prometheus.pkg and 'repo' in prometheus.pkg[name] and prometheus.pkg[name]['repo'] %}
|
|
|
|
{%- from tplroot ~ "/jinja/macros.jinja" import format_kwargs with context %}
|
2019-06-06 22:15:54 +02:00
|
|
|
|
2019-06-22 19:19:41 +02:00
|
|
|
prometheus-package-repo-install-{{ name }}-pkgrepo-managed:
|
2019-06-06 22:15:54 +02:00
|
|
|
pkgrepo.managed:
|
2019-06-22 19:19:41 +02:00
|
|
|
{{- format_kwargs(prometheus.pkg[name]['repo']) }}
|
2019-06-06 22:15:54 +02:00
|
|
|
|
2019-06-22 19:19:41 +02:00
|
|
|
prometheus-package-repo-install-{{ name }}-file-replace:
|
|
|
|
# redhat workaround for salt issue #51494
|
2019-06-06 22:15:54 +02:00
|
|
|
file.replace:
|
2019-06-22 19:19:41 +02:00
|
|
|
- name: /etc/yum.repos.d/{{ name }}.repo
|
2019-06-06 22:15:54 +02:00
|
|
|
- pattern: ' gpgkey2='
|
|
|
|
- repl: '\n '
|
|
|
|
- ignore_if_missing: True
|
|
|
|
- onlyif: {{ grains.os_family == 'RedHat' }}
|
|
|
|
|
2019-06-22 19:19:41 +02:00
|
|
|
{%- endif %}
|
|
|
|
{%- endfor %}
|