Commit a9b5b1bf by Toshio Kuratomi

Test that we can override variables set in inventory when the vars_file name is templated

Fixes #8903
parent 8dec4e3a
......@@ -6,6 +6,13 @@ testhost2 ansible_ssh_host=127.0.0.1 ansible_connection=local
# by (preferred) group_vars/ and host_vars/ variables
# and are used in testing of variable precedence
[inven_overridehosts]
invenoverride ansible_ssh_host=127.0.0.1 ansible_connection=local
[inven_overridehosts:vars]
foo=foo
var_dir=vars
[arbitrary_parent:children]
local
......
---
- debug: var=foo
- assert:
that:
- 'foo == "bar"'
......@@ -26,3 +26,11 @@
- 'vars_files_var == "vars_files_var"'
- 'vars_files_var_role == "vars_files_var_role3"'
- 'registered_var == "this is from set_fact"'
- hosts: inven_overridehosts
vars_files:
- "{{ var_dir }}/test_var_precedence.yml"
roles:
- role: test_var_precedence_inven_override
foo: bar
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment