fix(configuration): deploy sudoers rules for bool-or-string sudo values

This commit is contained in:
2026-07-14 01:48:26 +02:00
parent 41ccf2a5b9
commit 371d5a0acd

View File

@@ -15,8 +15,7 @@
validate: /usr/sbin/visudo --check --file=%s
- name: Deploy per-user sudoers rules
# Jinja truthiness: bool true / a rule string => deploy; false / '' / unset => skip.
when: item.value.sudo | default(false)
when: (item.value.sudo | default(false)) not in [false, '', none]
vars:
configuration_sudoers_rule: >-
{{ item.value.sudo if item.value.sudo is string else 'ALL=(ALL) NOPASSWD: ALL' }}