2019-06-17 23:02:51 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
|
|
|
|
|
2019-06-19 01:23:45 +02:00
|
|
|
{%- if grains.kernel|lower == 'linux' and p.linux.altpriority|int > 0 %}
|
2019-06-17 23:02:51 +02:00
|
|
|
|
2019-06-20 02:36:58 +02:00
|
|
|
{%- for name in p.wanted %}
|
|
|
|
{%- set bundle = name + '-%s.%s-%s'|format(p.pkg[name]['archive_version'], p.kernel, p.arch) %}
|
2019-06-17 23:02:51 +02:00
|
|
|
|
2019-06-20 02:36:58 +02:00
|
|
|
prometheus-archive-remove-{{ name }}-home-alternatives-remove:
|
2019-06-17 23:02:51 +02:00
|
|
|
alternatives.remove:
|
2019-06-20 02:36:58 +02:00
|
|
|
- name: prometheus-{{ name }}-home
|
|
|
|
- path: {{ p.dir.basedir }}/{{ bundle }}
|
|
|
|
- onlyif: update-alternatives --get-selections |grep ^prometheus-{{ name }}-home
|
|
|
|
|
|
|
|
{% for b in p.pkg[name]['binaries'] %}
|
2019-06-17 23:02:51 +02:00
|
|
|
|
2019-06-20 02:36:58 +02:00
|
|
|
prometheus-archive-remove-{{ name }}-alternatives-remove-{{ b }}:
|
2019-06-17 23:02:51 +02:00
|
|
|
alternatives.remove:
|
2019-06-20 02:36:58 +02:00
|
|
|
- name: prometheus-{{ name }}-{{ b }}
|
|
|
|
- path: {{ p.dir.basedir }}/{{ bundle }}/{{ b }}
|
|
|
|
- onlyif: update-alternatives --get-selections |grep ^prometheus-{{ name }}-{{ b }}
|
2019-06-17 23:02:51 +02:00
|
|
|
|
2019-06-20 02:36:58 +02:00
|
|
|
{% endfor %}
|
2019-06-17 23:02:51 +02:00
|
|
|
{% endfor %}
|
2019-06-19 01:23:45 +02:00
|
|
|
{%- endif %}
|