2019-06-08 19:39:21 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
2019-06-19 01:23:45 +02:00
|
|
|
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
|
2019-06-17 23:02:51 +02:00
|
|
|
{%- set sls_alternatives_clean = tplroot ~ '.archive.alternatives.clean' %}
|
2019-06-23 15:04:48 +02:00
|
|
|
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
|
2019-06-17 23:02:51 +02:00
|
|
|
|
|
|
|
include:
|
2019-06-23 15:04:48 +02:00
|
|
|
- {{ sls_service_clean }}
|
2019-06-17 23:02:51 +02:00
|
|
|
- {{ sls_alternatives_clean }}
|
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
prometheus-archive-clean-prerequisites:
|
2019-06-08 19:39:21 +02:00
|
|
|
file.absent:
|
2020-05-14 01:27:23 +02:00
|
|
|
- name: {{ p.dir.var }}
|
2019-06-19 01:23:45 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- for name in p.wanted.component %}
|
|
|
|
|
|
|
|
prometheus-archive-clean-{{ name }}:
|
|
|
|
file.absent:
|
|
|
|
- name: {{ p.pkg.component[name]['path'] }}
|
2019-06-19 01:23:45 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- if p.linux.altpriority|int <= 0 or grains.os_family|lower in ('macos', 'arch') %}
|
|
|
|
{%- 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-archive-clean-{{ name }}-file-symlink-{{ cmd }}:
|
2019-06-19 01:23:45 +02:00
|
|
|
file.absent:
|
2020-05-14 01:27:23 +02:00
|
|
|
- names:
|
|
|
|
- {{ p.dir.symlink }}/bin/{{ cmd }}
|
|
|
|
- {{ p.dir.symlink }}/sbin/{{ cmd }}
|
|
|
|
- {{ p.dir.var }}/{{ name }}
|
|
|
|
- {{ p.dir.service }}/{{ name }}.service
|
|
|
|
- require:
|
|
|
|
- sls: {{ sls_alternatives_clean }}
|
|
|
|
- sls: {{ sls_service_clean }}
|
|
|
|
- require_in:
|
|
|
|
- user: prometheus-archive-clean-{{ name }}-user-group
|
|
|
|
|
|
|
|
{%- endfor %}
|
|
|
|
{%- endif %}
|
|
|
|
{%- endif %}
|
|
|
|
{%- endfor %}
|