paulbsd-salt/states/users/users.sls

32 lines
690 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "users/map.jinja" import users with context -%}
{%- for user in users %}
2022-01-25 00:20:21 +01:00
2020-07-10 00:58:55 +02:00
{%- if not user.enabled %}
user-{{ user.name }}:
user.absent:
- name: {{ user.name }}
{%- endif %}
{%- if user.enabled %}
user-{{ user.name }}:
user.present:
- name: {{ user.name }}
- fullname: {{ user.fullname }}
- shell: {{ user.shell }}
- home: {{ user.home }}
- password: {{ user.password }}
2020-09-12 17:41:35 +02:00
- hash_password: true
2020-07-10 00:58:55 +02:00
- gid: {{ user.gid }}
2020-09-12 17:41:35 +02:00
- allow_gid_change: true
2020-07-10 00:58:55 +02:00
{%- if user.optional_groups is defined %}
- optional_groups:
{%- for opt_group in user.optional_groups %}
- {{ opt_group }}
{%- endfor %}
{%- endif %}
2022-01-25 00:20:21 +01:00
{%- endif %}
2020-07-10 00:58:55 +02:00
{% endfor %}