Change "Defaulting Undefined Variables" (#41379)

Rewording the text for the second parameter of default because the original text was misunderstandable. +label: docsite_pr
pull/45586/head
FloMiau 6 years ago committed by Alicia Cozine
parent 1ed57f1f64
commit e35c4be1c1

@ -89,8 +89,8 @@ Jinja2 provides a useful 'default' filter that is often a better approach to fai
In the above example, if the variable 'some_variable' is not defined, the value used will be 5, rather than an error In the above example, if the variable 'some_variable' is not defined, the value used will be 5, rather than an error
being raised. being raised.
If the variable evaluates to an empty string, the second parameter of the filter should be set to If you want to use the default value when variables evaluate to false or an empty string you have to set the second parameter to
`true`:: ``true``::
{{ lookup('env', 'MY_USER') | default('admin', true) }} {{ lookup('env', 'MY_USER') | default('admin', true) }}

Loading…
Cancel
Save