prometheus-formula/prometheus/archive/clean.sls

35 lines
947 B
Plaintext
Raw Normal View History

# -*- coding: utf-8 -*-
# vim: ft=sls
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
2019-06-19 01:23:45 +02:00
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
{%- set sls_alternatives_clean = tplroot ~ '.archive.alternatives.clean' %}
{%- set sls_users_clean = tplroot ~ '.config.users.clean' %}
include:
- {{ sls_users_clean }}
- {{ sls_alternatives_clean }}
2019-06-20 02:36:58 +02:00
{%- for name in p.wanted %}
2019-06-20 02:36:58 +02:00
prometheus-archive-clean-{{ name }}-file-absent:
file.absent:
2019-06-19 01:23:45 +02:00
- names:
2019-06-20 02:36:58 +02:00
- {{ p.dir.basedir }}/{{ name + '-%s.%s-%s'|format(p.pkg[name]['archive_version'], p.kernel, p.arch) }}
2019-06-19 01:23:45 +02:00
2019-06-20 02:36:58 +02:00
prometheus-archive-clean-{{ name }}-user-absent:
2019-06-19 01:23:45 +02:00
user.absent:
2019-06-20 02:36:58 +02:00
- name: {{ name }}
2019-06-19 01:23:45 +02:00
group.absent:
2019-06-20 02:36:58 +02:00
- name: {{ name }}
2019-06-19 01:23:45 +02:00
- require:
2019-06-20 02:36:58 +02:00
- user: prometheus-archive-clean-{{ name }}-user-absent
2019-06-19 01:23:45 +02:00
{%- endfor %}
prometheus-archive-clean-basedir-file-directory:
2019-06-19 01:23:45 +02:00
file.absent:
- name: {{ p.dir.basedir }}
2019-06-19 01:23:45 +02:00