2020-07-10 00:58:55 +02:00
|
|
|
---
|
|
|
|
{%- from "users/map.jinja" import users with context -%}
|
|
|
|
|
2022-06-08 23:48:21 +02:00
|
|
|
{%- for name, user in users.items() %}
|
|
|
|
|
|
|
|
{%- if not user.enabled %}
|
|
|
|
user-{{ name }}:
|
|
|
|
user.absent:
|
|
|
|
- name: {{ name }}
|
2020-07-10 00:58:55 +02:00
|
|
|
{%- endif %}
|
2022-06-08 23:48:21 +02:00
|
|
|
|
2020-07-10 00:58:55 +02:00
|
|
|
{%- if user.enabled %}
|
2022-06-08 23:48:21 +02:00
|
|
|
user-{{ name }}:
|
2020-07-10 00:58:55 +02:00
|
|
|
user.present:
|
2022-06-08 23:48:21 +02:00
|
|
|
- name: {{ name }}
|
2020-07-10 00:58:55 +02:00
|
|
|
- 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 %}
|