mirror of https://github.com/ansible/ansible.git
Fix order of resolving dependent role variables from vars files
Also adds a new class to the test_var_precedence test to check for this type of error in the future. Fixes #9178pull/9248/merge
parent
402d0c37b8
commit
0c40c6c23c
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
# should be overridden by vars_files in the main play
|
||||||
|
vars_files_var: "BAD!"
|
||||||
|
# should be seen in role1 (no override)
|
||||||
|
defaults_file_var_role1: "defaults_file_var_role1"
|
@ -0,0 +1,14 @@
|
|||||||
|
- debug: var=extra_var
|
||||||
|
- debug: var=param_var
|
||||||
|
- debug: var=vars_var
|
||||||
|
- debug: var=vars_files_var
|
||||||
|
- debug: var=vars_files_var_role
|
||||||
|
- debug: var=defaults_file_var_role1
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- 'extra_var == "extra_var"'
|
||||||
|
- 'param_var == "param_var_role1"'
|
||||||
|
- 'vars_var == "vars_var"'
|
||||||
|
- 'vars_files_var == "vars_files_var"'
|
||||||
|
- 'vars_files_var_role == "vars_files_var_dep"'
|
||||||
|
- 'defaults_file_var_role1 == "defaults_file_var_role1"'
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
# should override the global vars_files_var since it's local to the role
|
||||||
|
# but will be set to the value in the last role included which defines it
|
||||||
|
vars_files_var_role: "vars_files_var_dep"
|
@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- test_var_precedence_dep
|
Loading…
Reference in New Issue