1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

kept vars as alias to hostvars[inventory_hostname] and avoid subtrees into themselves

This commit is contained in:
Brian Coca 2015-08-23 12:50:15 -04:00
parent 3ccfebc9f7
commit af06a97f17

View file

@ -294,11 +294,8 @@ class VariableManager:
all_vars['ansible_version'] = CLI.version_info(gitinfo=False)
# make vars self referential, so people can do things like 'vars[var_name]'
copied_vars = all_vars.copy()
if 'hostvars' in copied_vars:
del copied_vars['hostvars']
all_vars['vars'] = copied_vars
if 'hostvars' in all_vars and host:
all_vars['vars'] = all_vars['hostvars'][host.get_name()]
#CACHED_VARS[cache_entry] = all_vars