Added section about boolean variables (#78653)

Co-authored-by: William Njuguna <william@coralogix.com>
pull/78691/head
wnjuguna 3 years ago committed by GitHub
parent 5f2bb2ba93
commit 077e1bfe17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -95,6 +95,26 @@ You will see: ``ERROR! Syntax Error while loading YAML.`` If you add quotes, Ans
vars:
app_path: "{{ base_path }}/22"
.. _boolean_variables:
Boolean variables
=================
Ansible accepts a broad range of values for boolean variables: ``true/false``, ``1/0``, ``yes/no``, ``True/False`` and so on. The matching of valid strings is case insensitive.
While documentation examples focus on ``true/false`` to be compatible with ``ansible-lint`` default settings, you can use any of the following:
.. table::
:class: documentation-table
=============================================================================================== ====================================================================
Valid values Description
=============================================================================================== ====================================================================
``True`` , ``'true'`` , ``'t'`` , ``'yes'`` , ``'y'`` , ``'on'`` , ``'1'`` , ``1`` , ``1.0`` Truthy values
``False`` , ``'false'`` , ``'f'`` , ``'no'`` , ``'n'`` , ``'off'`` , ``'0'`` , ``0`` , ``0.0`` Falsy values
=============================================================================================== ====================================================================
.. _list_variables:
List variables

@ -72,7 +72,7 @@ These are called "Flow collections".
.. _truthiness:
Ansible doesn't really use these too much, but you can also specify a boolean value (true/false) in several forms::
Ansible doesn't really use these too much, but you can also specify a :ref:`boolean value <playbooks_variables>` (true/false) in several forms::
create_key: yes
needs_agent: no

Loading…
Cancel
Save