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/docsite/rst/user_guide
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
..
shared_snippets
become.rst
command_line_tools.rst
index.rst
intro.rst Remove more docs build errors (#45364) 2018-09-11 17:51:47 +01:00
intro_adhoc.rst
intro_bsd.rst
intro_dynamic_inventory.rst
intro_getting_started.rst
intro_inventory.rst Changed hash_merge to link for ANSIBLE_HASH_BEHAVIOUR (#45996) 2018-09-24 15:03:55 -05:00
intro_patterns.rst
intro_windows.rst
module_defaults_config.rst Remove more docs build errors (#45364) 2018-09-11 17:51:47 +01:00
modules.rst
modules_intro.rst
modules_support.rst
playbook_pathing.rst Remove more docs build errors (#45364) 2018-09-11 17:51:47 +01:00
playbooks.rst
playbooks_advanced_syntax.rst
playbooks_async.rst
playbooks_best_practices.rst prefer ansible_facts namespace and dict notation (#44980) 2018-09-06 10:26:58 -05:00
playbooks_blocks.rst prefer ansible_facts namespace and dict notation (#44980) 2018-09-06 10:26:58 -05:00
playbooks_checkmode.rst
playbooks_conditionals.rst prefer ansible_facts namespace and dict notation (#44980) 2018-09-06 10:26:58 -05:00
playbooks_debugger.rst
playbooks_delegation.rst
playbooks_environment.rst
playbooks_error_handling.rst
playbooks_filters.rst adds support for null values to the ternary filter (#45303) 2018-09-24 18:57:19 -04:00
playbooks_filters_ipaddr.rst fixed grammar and spelling issues (#44931) 2018-08-31 08:44:31 -05:00
playbooks_intro.rst
playbooks_lookups.rst
playbooks_loops.rst
playbooks_module_defaults.rst
playbooks_prompts.rst
playbooks_python_version.rst
playbooks_reuse.rst
playbooks_reuse_includes.rst update example to YAML style in documentation (#45968) 2018-09-21 08:42:31 -05:00
playbooks_reuse_roles.rst prefer ansible_facts namespace and dict notation (#44980) 2018-09-06 10:26:58 -05:00
playbooks_roles.rst
playbooks_special_topics.rst
playbooks_startnstep.rst
playbooks_strategies.rst
playbooks_tags.rst
playbooks_templating.rst
playbooks_tests.rst prefer ansible_facts namespace and dict notation (#44980) 2018-09-06 10:26:58 -05:00
playbooks_variables.rst prefer ansible_facts namespace and dict notation (#44980) 2018-09-06 10:26:58 -05:00
playbooks_vault.rst
plugin_filtering_config.rst
quickstart.rst
vault.rst
windows.rst
windows_dsc.rst Fix link and toctree (#45595) 2018-09-13 12:38:49 -05:00
windows_faq.rst
windows_setup.rst Fix link and toctree (#45595) 2018-09-13 12:38:49 -05:00
windows_usage.rst Fix link and toctree (#45595) 2018-09-13 12:38:49 -05:00
windows_winrm.rst Add workaround for non-standard kerberos environments (#41465) 2018-09-18 09:33:09 -05:00