diff options
Diffstat (limited to '')
3 files changed, 24 insertions, 0 deletions
diff --git a/test/integration/targets/var_precedence/roles/test_var_precedence_role2/defaults/main.yml b/test/integration/targets/var_precedence/roles/test_var_precedence_role2/defaults/main.yml new file mode 100644 index 0000000..8ed63ce --- /dev/null +++ b/test/integration/targets/var_precedence/roles/test_var_precedence_role2/defaults/main.yml @@ -0,0 +1,5 @@ +--- +# should be overridden by vars_files in the main play +vars_files_var: "BAD!" +# should be overridden by the vars file in role2 +defaults_file_var_role2: "BAD!" diff --git a/test/integration/targets/var_precedence/roles/test_var_precedence_role2/tasks/main.yml b/test/integration/targets/var_precedence/roles/test_var_precedence_role2/tasks/main.yml new file mode 100644 index 0000000..a862389 --- /dev/null +++ b/test/integration/targets/var_precedence/roles/test_var_precedence_role2/tasks/main.yml @@ -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_role2"' + - 'vars_var == "vars_var"' + - 'vars_files_var == "vars_files_var"' + - 'vars_files_var_role == "vars_files_var_role2"' + - 'defaults_file_var_role2 == "overridden by role vars"' diff --git a/test/integration/targets/var_precedence/roles/test_var_precedence_role2/vars/main.yml b/test/integration/targets/var_precedence/roles/test_var_precedence_role2/vars/main.yml new file mode 100644 index 0000000..483c5ea --- /dev/null +++ b/test/integration/targets/var_precedence/roles/test_var_precedence_role2/vars/main.yml @@ -0,0 +1,5 @@ +--- +# should override the global vars_files_var since it's local to the role +vars_files_var_role: "vars_files_var_role2" +# should override the value in defaults/main.yml for role 2 +defaults_file_var_role2: "overridden by role vars" |