1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/docs
Peter Sprygada 1e68881c40 adds support for null values to the ternary filter (#45303)
* adds support for null values to the ternary filter

This change adds a third optional argument to the ternary filter to
handle a null value.  If the third option is specified null and false
are treated differently.

For instance, take the following example:

{{ enabled | ternary('no shutdown', 'shutdown') }}

If enabled == True, then 'no shutdown' is used.
If enabled in (False, None), then 'shutdown' is used.

With this change the following is possible:

{{ enabled | ternary('no shutdown', 'shutdown', omit) }}

If enabled == True, then 'no shutdown'
If enabled == False, then 'shutdown'
If enabled == None, then omit

* update documentation with example of filter

* update filter documentation example per comments

* fix logic error in user_guide example
2018-09-24 18:57:19 -04:00
..
api docs: PEP8 compliance (#24681) 2017-05-30 18:08:25 +01:00
bin Docs: Make docsite rebuilds smarter/faster (#45062) 2018-09-12 13:50:36 -07:00
docsite adds support for null values to the ternary filter (#45303) 2018-09-24 18:57:19 -04:00
man added docs to CLI docstringsadded 2017-03-24 15:52:36 -04:00
templates Only print warning when ansible.cfg is actually skipped (#43583) 2018-08-03 10:39:33 -07:00