Adding 'role_path' to VariableManager "magic" variables (v2)

pull/10995/merge
James Cammarata 9 years ago
parent 7b1c6fbab9
commit fd321355d6

@ -212,7 +212,6 @@ class VariableManager:
# FIXME: make sure all special vars are here
# Finally, we create special vars
if host:
all_vars['groups'] = [group.name for group in host.get_groups()]
@ -220,6 +219,10 @@ class VariableManager:
hostvars = HostVars(vars_manager=self, inventory=self._inventory, loader=loader)
all_vars['hostvars'] = hostvars
if task:
if task._role:
all_vars['role_path'] = task._role._role_path
if self._inventory is not None:
all_vars['inventory_dir'] = self._inventory.basedir()

Loading…
Cancel
Save