prometheus-formula/prometheus/archive/alternatives/clean.sls

30 lines
1.0 KiB
Plaintext
Raw Normal View History

# -*- 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-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-20 02:36:58 +02:00
prometheus-archive-remove-{{ name }}-home-alternatives-remove:
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-20 02:36:58 +02:00
prometheus-archive-remove-{{ name }}-alternatives-remove-{{ b }}:
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-20 02:36:58 +02:00
{% endfor %}
{% endfor %}
2019-06-19 01:23:45 +02:00
{%- endif %}