fix(global_defaults): validate system.users as the documented dict on both paths
This commit is contained in:
@@ -8,11 +8,10 @@
|
||||
that:
|
||||
- system is mapping
|
||||
- system.network is not defined or system.network is mapping
|
||||
- system.users is not defined or system.users is mapping
|
||||
- system.root is not defined or system.root is mapping
|
||||
- system.luks is not defined or system.luks is mapping
|
||||
- system.features is not defined or system.features is mapping
|
||||
fail_msg: "system and its nested keys (network, root, luks, features, users) must be dictionaries."
|
||||
fail_msg: "system and its nested keys (network, root, luks, features) must be dictionaries."
|
||||
quiet: true
|
||||
|
||||
- name: Validate DNS lists (not strings)
|
||||
@@ -24,19 +23,6 @@
|
||||
fail_msg: "system.network.dns.servers and system.network.dns.search must be lists, not strings."
|
||||
quiet: true
|
||||
|
||||
- name: Validate system.users entries
|
||||
when: system.users is defined and system.users is mapping and system.users | length > 0
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- item.value is mapping
|
||||
- item.key | string | length > 0
|
||||
- ('keys' not in item.value) or (item.value['keys'] is iterable and item.value['keys'] is not string)
|
||||
fail_msg: "Each system.users entry must be a dict keyed by username; 'keys' must be a list."
|
||||
quiet: true
|
||||
loop: "{{ system.users | dict2items }}"
|
||||
loop_control:
|
||||
label: "{{ item.key }}"
|
||||
|
||||
- name: Validate system features input types
|
||||
when: system.features is defined
|
||||
loop: "{{ system_defaults.features | dict2items | map(attribute='key') | list }}"
|
||||
|
||||
Reference in New Issue
Block a user