Conditional bare: fix typos (#53807)
This commit is contained in:
parent
3b8768158f
commit
dbb782a594
3 changed files with 9 additions and 9 deletions
|
@ -319,14 +319,14 @@ COLOR_WARN:
|
|||
env: [{name: ANSIBLE_COLOR_WARN}]
|
||||
ini:
|
||||
- {key: warn, section: colors}
|
||||
CONDITINAL_BARE_VARS:
|
||||
CONDITIONAL_BARE_VARS:
|
||||
name: Allow bare variable evaluation in conditionals
|
||||
default: True
|
||||
type: boolean
|
||||
description:
|
||||
- With this setting on (True), runing conditional evaluation 'var' is treated differently 'var.subkey' as the first is evaluted
|
||||
directly while the second goes though the Jinja2 parser. But 'false' strings in 'var' get evaluated as booleans.
|
||||
- With this settting off they both evalutate the same but in cases in which 'var' was 'false' (a string) it won't get evaluated as a boolean anymore.
|
||||
- With this setting on (True), running conditional evaluation 'var' is treated differently than 'var.subkey' as the first is evaluated
|
||||
directly while the second goes through the Jinja2 parser. But 'false' strings in 'var' get evaluated as booleans.
|
||||
- With this setting off they both evaluate the same but in cases in which 'var' was 'false' (a string) it won't get evaluated as a boolean anymore.
|
||||
- Currently this setting defaults to 'True' but will soon change to 'False' and the setting itself will be removed in the future.
|
||||
- Expect the default to change in version 2.10 and that this setting eventually will be deprecated after 2.12
|
||||
env: [{name: ANSIBLE_CONDITIONAL_BARE_VARS}]
|
||||
|
|
|
@ -114,7 +114,7 @@ class Conditional:
|
|||
if isinstance(conditional, bool):
|
||||
return conditional
|
||||
|
||||
if C.CONDITINAL_BARE_VARS:
|
||||
if C.CONDITIONAL_BARE_VARS:
|
||||
if conditional in all_vars and VALID_VAR_REGEX.match(conditional):
|
||||
display.deprecated('evaluating %s as a bare variable, this behaviour will go away and you might need to add |bool'
|
||||
' to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle.' % conditional, "2.12")
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
vars_files:
|
||||
- vars/main.yml
|
||||
tasks:
|
||||
- name: set conditial bare vars status
|
||||
- name: set conditional bare vars status
|
||||
set_fact:
|
||||
bare: "{{lookup('config', 'CONDITINAL_BARE_VARS')|bool}}"
|
||||
bare: "{{lookup('config', 'CONDITIONAL_BARE_VARS')|bool}}"
|
||||
|
||||
- name: test conditional '=='
|
||||
shell: echo 'testing'
|
||||
|
@ -536,14 +536,14 @@
|
|||
- top is skipped
|
||||
- sub is skipped
|
||||
|
||||
- name: test that 'comparisson expression' item works with_items
|
||||
- name: test that 'comparison expression' item works with_items
|
||||
assert:
|
||||
that:
|
||||
- item
|
||||
with_items:
|
||||
- 1 == 1
|
||||
|
||||
- name: test that 'comparisson expression' item works in loop
|
||||
- name: test that 'comparison expression' item works in loop
|
||||
assert:
|
||||
that:
|
||||
- item
|
||||
|
|
Loading…
Reference in a new issue