mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
When var name is the same as var content, try to template it before reporting that var is not defined. (#13629)
* When var name is the same as var content, try to template it before reporting that var is not defined. Add asserts in test_var_blending to check this special corner case. * Fix integration tests when using debug with list or dict.
This commit is contained in:
@@ -34,3 +34,15 @@
|
||||
that:
|
||||
- 'diff_result.stdout == ""'
|
||||
|
||||
- name: check debug variable with same name as var content
|
||||
debug: var=same_value_as_var_name_var
|
||||
register: same_value_as_var_name
|
||||
|
||||
- name: check debug variable output when variable is undefined
|
||||
debug: var=undefined_variable
|
||||
register: var_undefined
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- var_undefined.undefined_variable == 'VARIABLE IS NOT DEFINED!'
|
||||
- same_value_as_var_name.same_value_as_var_name_var == 'same_value_as_var_name_var'
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
badwolf: badwolf
|
||||
|
||||
same_value_as_var_name_var: "same_value_as_var_name_var"
|
||||
|
||||
Reference in New Issue
Block a user