diff --git a/tasks/users_default.yml b/tasks/users_default.yml index 9b3efb7..c2e0068 100644 --- a/tasks/users_default.yml +++ b/tasks/users_default.yml @@ -10,7 +10,7 @@ user: name: "{{ item.name }}" groups: "{{ item.groups | default([]) | join(',') or omit }}" - append: yes + append: "{{ True if (item.groups | default([]) | length > 0) else False }}" password: "{{ item.password | password_hash('sha512',65534 | random(seed=inventory_hostname) | string) if item.password is defined else omit }}" shell: "{{ item.shell | default('/bin/bash') }}" loop: "{{ users_default_users }}" diff --git a/tasks/users_univention.yml b/tasks/users_univention.yml index 8bbacc3..84627c6 100644 --- a/tasks/users_univention.yml +++ b/tasks/users_univention.yml @@ -13,7 +13,7 @@ user: name: "{{ item.name }}" groups: "{{ item.groups | default([]) | join(',') or omit }}" - append: yes + append: "{{ True if (item.groups | default([]) | length > 0) else False }}" password: "{{ item.password | default(omit) | password_hash('sha512',65534 | random(seed=inventory_hostname) | string) }}" shell: "{{ item.shell | default('/bin/bash') }}" system: 'yes'