updated users state

This commit is contained in:
Paul 2022-12-24 17:50:27 +01:00
parent 2f40804e70
commit 2fa5c1fb6a
3 changed files with 4 additions and 8 deletions

View File

@ -2,4 +2,4 @@
include:
- .groups
- .users
- .ssh-keys
- .sshkeys

View File

@ -2,7 +2,7 @@
{%- from "users/map.jinja" import users with context -%}
{%- for name, user in users.items() %}
{%- if "sys" in user.roles %}
{%- if not user.enabled %}
user-{{ name }}:
user.absent:
@ -20,12 +20,7 @@ user-{{ name }}:
- hash_password: true
- gid: {{ user.gid }}
- allow_gid_change: true
{%- if user.optional_groups is defined %}
- optional_groups:
{%- for opt_group in user.optional_groups %}
- {{ opt_group }}
{%- endfor %}
{%- endif %}
{% if user.optional_groups is defined %}- optional_groups: {{ user.optional_groups }}{% endif %}
user-{{ name }}-config-dir:
file.directory:
@ -34,5 +29,6 @@ user-{{ name }}-config-dir:
- group: {{ user.gid }}
- mode: 0755
{%- endif %}
{%- endif %}
{% endfor %}