mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-01 19:54:24 -07:00
kept vars as alias to hostvars[inventory_hostname] and avoid subtrees into themselves
This commit is contained in:
parent
3ccfebc9f7
commit
af06a97f17
1 changed files with 2 additions and 5 deletions
|
@ -294,11 +294,8 @@ class VariableManager:
|
||||||
|
|
||||||
all_vars['ansible_version'] = CLI.version_info(gitinfo=False)
|
all_vars['ansible_version'] = CLI.version_info(gitinfo=False)
|
||||||
|
|
||||||
# make vars self referential, so people can do things like 'vars[var_name]'
|
if 'hostvars' in all_vars and host:
|
||||||
copied_vars = all_vars.copy()
|
all_vars['vars'] = all_vars['hostvars'][host.get_name()]
|
||||||
if 'hostvars' in copied_vars:
|
|
||||||
del copied_vars['hostvars']
|
|
||||||
all_vars['vars'] = copied_vars
|
|
||||||
|
|
||||||
#CACHED_VARS[cache_entry] = all_vars
|
#CACHED_VARS[cache_entry] = all_vars
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue