Skip to content

truthy

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 'true'.
  • It is the opposite of P(ansible.builtin.falsy#test).

Parameters

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

Examples

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

Return Values

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

Authors

  • Ansible Core