summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins/filter/bool.yml
blob: beb8b8ddb1fa0f2a22c1fa3cac5888986d2d03ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
DOCUMENTATION:
  name: bool
  version_added: "historical"
  short_description: cast into a boolean
  description:
    - Attempt to cast the input into a boolean (V(True) or V(False)) value.
  positional: _input
  options:
    _input:
      description: Data to cast.
      type: raw
      required: true

EXAMPLES: |

  # in vars
  vars:
    isbool: "{{ (a == b) | bool }} "
    otherbool: "{{ anothervar | bool }} "

  # in a task
  ...
  when: some_string_value | bool

RETURN:
  _value:
    description: The boolean resulting of casting the input expression into a V(True) or V(False) value.
    type: bool