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 }}
|
{{ ansible_managed | comment }}
|
||||||
|
|
||||||
{% for name, user in pve_auth__users.items() %}
|
{% for name, user in pve_auth__users.items() %}
|
||||||
{% if user.enabled | default(True) %}
|
|
||||||
{{ name }}:{{ user.password }}:
|
{{ name }}:{{ user.password }}:
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
{{ ansible_managed | comment }}
|
{{ ansible_managed | comment }}
|
||||||
|
|
||||||
{% for name, user in pve_auth__users.items() %}
|
{% for name, user in pve_auth__users.items() %}
|
||||||
{% if user.enabled | default(True) %}
|
{% set enabled = user.enabled | default(True) %}
|
||||||
user:{{ name }}@pve:1:0::::::
|
user:{{ name }}@pve:{{ enabled | ternary(1, 0) }}:0::::::
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for group in pve_auth__groups.keys() %}
|
{% for group in pve_auth__groups.keys() %}
|
||||||
{% set users = pve_auth__users
|
{% set users = pve_auth__users
|
||||||
| selectattr("groups", "defined")
|
| dict2items
|
||||||
| selectattr("groups", "contains", group) %}
|
| selectattr("value.groups", "defined")
|
||||||
|
| selectattr("value.groups", "contains", group)
|
||||||
|
| map(attribute="key")
|
||||||
|
| map("suffix", "@pve") %}
|
||||||
group:{{ group }}:{{ users | join(",") }}::
|
group:{{ group }}:{{ users | join(",") }}::
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue