prometheus-formula/prometheus/config/users.sls
2020-10-19 16:25:52 +01:00

27 lines
811 B
Plaintext

# -*- coding: utf-8 -*-
# vim: ft=sls
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
{%- for name in p.wanted.component %}
prometheus-config-user-install-{{ name }}-user-present:
group.present:
- name: {{ name }}
- require_in:
- user: prometheus-config-user-install-{{ name }}-user-present
user.present:
- name: {{ name }}
- groups:
- {{ name }}
{%- if grains.os != 'Windows' %}
- shell: /bin/false
{%- if grains.kernel|lower == 'linux' %}
- createhome: false
{%- elif grains.os_family == 'MacOS' %}
- unless: /usr/bin/dscl . list /Users | grep {{ name }} >/dev/null 2>&1
{%- endif %}
{%- endif %}
{%- endfor %}