-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Env
ansible [core 2.19.0]
python version = 3.12.11 (main, Jul 2 2025, 11:18:53)
jinja version = 3.1.6
pyyaml version = 6.0.2 (with libyaml v0.2.5)Error output
[ERROR]: Task failed: Conditional result was '' of type 'str', which evaluates to False. Conditionals must have a boolean result.
Task failed.
Origin: .ansible/roles/weareinteractive.users/tasks/manage.yml:3:3
1 ---
2
3 - name: Adding primary group
^ column 3
<<< caused by >>>
Conditional result was '' of type 'str', which evaluates to False. Conditionals must have a boolean result.
Origin: .ansible/roles/weareinteractive.users/tasks/manage.yml:7:9
5 name: "{{ users_group }}"
6 state: present
7 when: users_group is defined and users_group
^ column 9
Broken conditionals can be temporarily allowed with the `ALLOW_BROKEN_CONDITIONALS` configuration option.
fatal: [runner01]: FAILED! => {"changed": false, "msg": "Task failed: Conditional result was '' of type 'str', which evaluates to False. Conditionals must have a boolean result."}Suggested solution
- Set an empty string in defaults/main.yml file to indicate the expected type and also provide a default value
- Fix conditional to allow users to skip the task if unwilling to set a primary group
Metadata
Metadata
Assignees
Labels
No labels