pve_auth: fix groups + enabled
This commit is contained in:
parent
8f51a2fb80
commit
1978f12794
2 changed files with 7 additions and 7 deletions
|
@ -1,7 +1,5 @@
|
|||
{{ ansible_managed | comment }}
|
||||
|
||||
{% for name, user in pve_auth__users.items() %}
|
||||
{% if user.enabled | default(True) %}
|
||||
{{ name }}:{{ user.password }}:
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
{{ ansible_managed | comment }}
|
||||
|
||||
{% for name, user in pve_auth__users.items() %}
|
||||
{% if user.enabled | default(True) %}
|
||||
user:{{ name }}@pve:1:0::::::
|
||||
{% endif %}
|
||||
{% set enabled = user.enabled | default(True) %}
|
||||
user:{{ name }}@pve:{{ enabled | ternary(1, 0) }}:0::::::
|
||||
{% endfor %}
|
||||
|
||||
{% for group in pve_auth__groups.keys() %}
|
||||
{% set users = pve_auth__users
|
||||
| selectattr("groups", "defined")
|
||||
| selectattr("groups", "contains", group) %}
|
||||
| dict2items
|
||||
| selectattr("value.groups", "defined")
|
||||
| selectattr("value.groups", "contains", group)
|
||||
| map(attribute="key")
|
||||
| map("suffix", "@pve") %}
|
||||
group:{{ group }}:{{ users | join(",") }}::
|
||||
{% endfor %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue