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
|
|
|
|
2023-02-15 01:57:08 +01:00
|
|
|
{%- if p.manage_user_group or p.pkg.use_upstream_archive %}
|
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 }}
|
2021-12-13 23:20:54 +01:00
|
|
|
- system: true
|
2019-06-22 19:24:19 +02:00
|
|
|
- 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
|
2021-07-18 15:40:17 +02:00
|
|
|
- system: true
|
2020-10-19 14:57:29 +02:00
|
|
|
{%- 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 %}
|
2023-02-15 01:57:08 +01:00
|
|
|
{%- endif %}
|