|
|
@ -43,7 +43,6 @@ from ansible.template import Templar
|
|
|
|
from ansible.utils.debug import debug
|
|
|
|
from ansible.utils.debug import debug
|
|
|
|
from ansible.utils.listify import listify_lookup_plugin_terms
|
|
|
|
from ansible.utils.listify import listify_lookup_plugin_terms
|
|
|
|
from ansible.utils.vars import combine_vars
|
|
|
|
from ansible.utils.vars import combine_vars
|
|
|
|
from ansible.vars.hostvars import HostVars
|
|
|
|
|
|
|
|
from ansible.vars.unsafe_proxy import wrap_var
|
|
|
|
from ansible.vars.unsafe_proxy import wrap_var
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -171,7 +170,8 @@ class VariableManager:
|
|
|
|
|
|
|
|
|
|
|
|
return data
|
|
|
|
return data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# FIXME: include_hostvars is no longer used, and should be removed, but
|
|
|
|
|
|
|
|
# all other areas of code calling get_vars need to be fixed too
|
|
|
|
def get_vars(self, loader, play=None, host=None, task=None, include_hostvars=True, include_delegate_to=True, use_cache=True):
|
|
|
|
def get_vars(self, loader, play=None, host=None, task=None, include_hostvars=True, include_delegate_to=True, use_cache=True):
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
Returns the variables, with optional "context" given via the parameters
|
|
|
|
Returns the variables, with optional "context" given via the parameters
|
|
|
@ -367,17 +367,6 @@ class VariableManager:
|
|
|
|
variables['groups'] = dict()
|
|
|
|
variables['groups'] = dict()
|
|
|
|
for (group_name, group) in iteritems(self._inventory.groups):
|
|
|
|
for (group_name, group) in iteritems(self._inventory.groups):
|
|
|
|
variables['groups'][group_name] = [h.name for h in group.get_hosts()]
|
|
|
|
variables['groups'][group_name] = [h.name for h in group.get_hosts()]
|
|
|
|
|
|
|
|
|
|
|
|
#if include_hostvars:
|
|
|
|
|
|
|
|
# hostvars_cache_entry = self._get_cache_entry(play=play)
|
|
|
|
|
|
|
|
# if hostvars_cache_entry in HOSTVARS_CACHE:
|
|
|
|
|
|
|
|
# hostvars = HOSTVARS_CACHE[hostvars_cache_entry]
|
|
|
|
|
|
|
|
# else:
|
|
|
|
|
|
|
|
# hostvars = HostVars(play=play, inventory=self._inventory, loader=loader, variable_manager=self)
|
|
|
|
|
|
|
|
# HOSTVARS_CACHE[hostvars_cache_entry] = hostvars
|
|
|
|
|
|
|
|
# variables['hostvars'] = hostvars
|
|
|
|
|
|
|
|
# variables['vars'] = hostvars[host.get_name()]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if play:
|
|
|
|
if play:
|
|
|
|
variables['role_names'] = [r._role_name for r in play.roles]
|
|
|
|
variables['role_names'] = [r._role_name for r in play.roles]
|
|
|
|
|
|
|
|
|
|
|
|