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