diff --git a/roles/configuration/tasks/sudo.yml b/roles/configuration/tasks/sudo.yml index dff8c93..c5c64b0 100644 --- a/roles/configuration/tasks/sudo.yml +++ b/roles/configuration/tasks/sudo.yml @@ -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' }}