2019-06-22 19:24:19 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{%- from tplroot ~ "/map.jinja" import prometheus with context %}
|
|
|
|
|
|
|
|
{%- for name in prometheus.wanted %}
|
|
|
|
|
|
|
|
prometheus-config-user-clean-{{ name }}-user-absent:
|
|
|
|
user.absent:
|
|
|
|
- name: {{ name }}
|
2019-06-23 15:04:48 +02:00
|
|
|
{%- if grains.os_family == 'MacOS' %}
|
|
|
|
- onlyif: /usr/bin/dscl . list /Users | grep {{ name }} >/dev/null 2>&1
|
|
|
|
{%- endif %}
|
2019-06-22 19:24:19 +02:00
|
|
|
group.absent:
|
|
|
|
- name: {{ name }}
|
|
|
|
- require:
|
|
|
|
- user: prometheus-config-user-clean-{{ name }}-user-absent
|
|
|
|
|
|
|
|
{%- endfor %}
|