fix: conditionally enable groups append to avoid warnings
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2022-09-04 14:33:07 +02:00
parent 31fa160f4e
commit 19a41eb843
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@
user: user:
name: "{{ item.name }}" name: "{{ item.name }}"
groups: "{{ item.groups | default([]) | join(',') or omit }}" 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 }}" 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') }}" shell: "{{ item.shell | default('/bin/bash') }}"
loop: "{{ users_default_users }}" loop: "{{ users_default_users }}"

View File

@ -13,7 +13,7 @@
user: user:
name: "{{ item.name }}" name: "{{ item.name }}"
groups: "{{ item.groups | default([]) | join(',') or omit }}" 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) }}" password: "{{ item.password | default(omit) | password_hash('sha512',65534 | random(seed=inventory_hostname) | string) }}"
shell: "{{ item.shell | default('/bin/bash') }}" shell: "{{ item.shell | default('/bin/bash') }}"
system: 'yes' system: 'yes'