ansible/test/integration/targets/conditionals/vars/main.yml
Rick Elrod 19aeb4706d
[conditional] Remove support for bare variables (#74208)
Change:
- Variables used in ``when`` conditionals are no longer parsed and
  attempted to be converted to booleans. All non-empty strings are
  considered true (empty strings, false).

Test Plan:
- Updated existing tests
- Added a bunch of new tests with various kinds of truthy/falsy
  values.

Tickets:
- Fixes #74134

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-13 11:12:10 -04:00

29 lines
526 B
YAML

---
# foo is a dictionary that will be used to check that
# a conditional passes a with_items loop on a variable
# with a missing attribute (ie. foo.results)
cond_bad_attribute:
bar: a
cond_list_of_items:
results:
- a
- b
- c
things1:
- 1
- 2
vars_file_var: 321
test_bare: true
test_bare_var: 123
test_bare_nested_good: "test_bare_var == 123"
test_bare_nested_bad: "{{test_bare_var}} == 321"
string_lit_true: "true"
string_lit_false: "false"
string_lit_empty: ""
lit_null: null
int_lit_0: 0
int_lit_1: 1