2019-06-22 19:24:19 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
|
2019-06-22 19:24:19 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- for name in p.wanted.component %}
|
2019-06-22 19:24:19 +02:00
|
|
|
|
2020-11-03 10:34:46 +01:00
|
|
|
prometheus-config-users-install-{{ name }}-group-present:
|
2019-06-22 19:24:19 +02:00
|
|
|
group.present:
|
|
|
|
- name: {{ name }}
|
|
|
|
- require_in:
|
2020-11-03 10:34:46 +01:00
|
|
|
- user: prometheus-config-users-install-{{ name }}-user-present
|
|
|
|
|
|
|
|
prometheus-config-users-install-{{ name }}-user-present:
|
2019-06-22 19:24:19 +02:00
|
|
|
user.present:
|
|
|
|
- name: {{ name }}
|
|
|
|
- groups:
|
|
|
|
- {{ name }}
|
2020-10-19 14:57:29 +02:00
|
|
|
{%- if grains.os != 'Windows' %}
|
2021-08-06 07:58:26 +02:00
|
|
|
- shell: {{ p.shell }}
|
2020-10-19 14:57:29 +02:00
|
|
|
{%- if grains.kernel|lower == 'linux' %}
|
|
|
|
- createhome: false
|
|
|
|
{%- elif grains.os_family == 'MacOS' %}
|
2019-06-23 15:04:48 +02:00
|
|
|
- unless: /usr/bin/dscl . list /Users | grep {{ name }} >/dev/null 2>&1
|
2020-10-19 14:57:29 +02:00
|
|
|
{%- endif %}
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- endif %}
|
2020-11-03 10:34:46 +01:00
|
|
|
|
2019-06-22 19:24:19 +02:00
|
|
|
{%- endfor %}
|