Skip to content

falsy

Collection Note

This module is part of the ansible.builtin collection. To install the collection, use:

ansible-galaxy collection install ansible.builtin
Added in version 2.10.

Synopsis

  • This check is a more Python version of what is 'false'.
  • It is the opposite of 'truthy'.

Parameters

Parameter Defaults / Choices Comments
_input
string
required
An expression that can be expressed in a boolean context.
convert_bool
bool
Attempts to convert the result to a strict Python boolean vs normally acceptable values (V(yes)/V(no), V(on)/V(off), V(0)/V(1), etc).

Examples

thisisfalse: '{{ "any string" is falsy }}'
thisistrue: '{{ "" is falsy }}'

Return Values

Key Data Type Description Returned
_value boolean Returns V(False) if the condition is not "Python truthy", V(True) otherwise.

Authors

  • Ansible Core