2019-06-06 22:15:54 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
2020-08-21 15:33:20 +02:00
|
|
|
{%- if grains.os_family == 'RedHat' %}
|
2019-06-06 22:15:54 +02:00
|
|
|
|
2020-08-21 15:33:20 +02:00
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
|
|
|
|
|
|
|
|
{%- if p.pkg.use_upstream_repo and 'repo' in p.pkg and p.pkg.repo %}
|
|
|
|
{%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
|
2019-06-06 22:15:54 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
prometheus-package-repo-install-pkgrepo-managed:
|
2019-06-06 22:15:54 +02:00
|
|
|
pkgrepo.managed:
|
2020-08-10 00:14:56 +02:00
|
|
|
{{- format_kwargs(p.pkg.repo) }}
|
2019-06-06 22:15:54 +02:00
|
|
|
file.replace:
|
2020-05-14 01:27:23 +02:00
|
|
|
# redhat workaround for salt issue #51494
|
|
|
|
- name: /etc/yum.repos.d/prometheus.repo
|
2019-06-06 22:15:54 +02:00
|
|
|
- pattern: ' gpgkey2='
|
|
|
|
- repl: '\n '
|
|
|
|
- ignore_if_missing: True
|
2020-08-21 15:33:20 +02:00
|
|
|
{%- endif %}
|
|
|
|
|
|
|
|
{%- else %}
|
|
|
|
|
|
|
|
prometheus-package-repo-install-pkgrepo-managed:
|
|
|
|
test.show_notification:
|
|
|
|
- name: Skipping repository configuration
|
|
|
|
- text: |
|
|
|
|
At the moment, there's no repo for {{ grains['os'] }}
|
|
|
|
See https://prometheus.io/download/
|
2019-06-06 22:15:54 +02:00
|
|
|
|
2020-08-21 15:33:20 +02:00
|
|
|
{%- endif %}
|