2019-06-17 23:02:51 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
|
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- if grains.kernel|lower == 'linux' and p.linux.altpriority|int > 0 and grains.os_family != 'Arch' %}
|
|
|
|
{%- if 'wanted' in p and p.wanted and 'component' in p.wanted and p.wanted.component %}
|
2019-06-17 23:02:51 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- for name in p.wanted.component %}
|
|
|
|
{%- if 'commands' in p.pkg.component[name] and p.pkg.component[name]['commands'] is iterable %}
|
|
|
|
{%- for cmd in p.pkg.component[name]['commands'] %}
|
2019-06-17 23:02:51 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
prometheus-server-alternatives-clean-{{ name }}-{{ cmd }}:
|
2019-06-17 23:02:51 +02:00
|
|
|
alternatives.remove:
|
2020-05-14 01:27:23 +02:00
|
|
|
- unless: {{ p.pkg.use_upstream_repo }}
|
|
|
|
- name: link-prometheus-{{ name }}-{{ cmd }}
|
|
|
|
- path: {{ p.pkg.component[name]['path'] }}/{{ cmd }}
|
|
|
|
- onlyif: update-alternatives --get-selections |grep ^prometheus-{{ name }}-{{ cmd }}
|
2019-06-20 02:36:58 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- endfor %}
|
|
|
|
{%- endif %}
|
|
|
|
{%- endfor %}
|
2019-06-17 23:02:51 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- endif %}
|
|
|
|
{%- endif %}
|