bool¶
Collection Note
This module is part of the ansible.builtin collection. To install the collection, use:
Added in versionhistorical.
Synopsis¶
- Attempt to cast the input into a boolean (V(True) or V(False)) value.
Parameters¶
| Parameter | Defaults / Choices | Comments |
|---|---|---|
| _input raw required |
Data to cast. |
Examples¶
# in vars
vars:
isbool: "{{ (a == b) | bool }} "
otherbool: "{{ anothervar | bool }} "
# in a task
...
when: some_string_value | bool
Return Values¶
| Key | Data Type | Description | Returned |
|---|---|---|---|
| _value | bool | The boolean resulting of casting the input expression into a V(True) or V(False) value. |