fix(global_defaults): read dict2items key and key enrichment on os

This commit is contained in:
2026-09-15 21:05:37 +02:00
parent 96220d424e
commit 9cc0c704a7
2 changed files with 7 additions and 7 deletions
+4 -6
View File
@@ -317,7 +317,7 @@
_autologin: "{{ system_cfg.features.desktop.autologin | default(false) }}"
ansible.builtin.assert:
that:
- _autologin is boolean and not _autologin or (_autologin is string and _autologin | length > 0 and _autologin in system_cfg.users)
- _autologin is boolean and not _autologin or (_autologin is string and _autologin | length > 0 and _autologin in system_cfg.users | map(attribute='name'))
fail_msg: >-
desktop.autologin must be false or a username string present in
system.users; got '{{ _autologin }}'. Bool true is not accepted - the
@@ -355,14 +355,12 @@
- name: Validate at least one user with a password is defined
vars:
_pw_users: "{{ system_cfg.users | dict2items | selectattr('value.password', 'defined') | list }}"
_pw_users: "{{ system_cfg.users | selectattr('password', 'defined') | map(attribute='password') | map('string') | reject('equalto', '') | list }}"
ansible.builtin.assert:
that:
- system_cfg.users | default({}) | length > 0
- system_cfg.users | default([]) | length > 0
- _pw_users | length > 0
- _pw_users[0].key | string | length > 0
- _pw_users[0].value.password | string | length > 0
fail_msg: "At least one user with a password must be defined in system.users."
fail_msg: "At least one user with a non-empty password must be defined in system.users."
quiet: true
no_log: true