Adding 'role_path' to VariableManager "magic" variables (v2)
This commit is contained in:
parent
7b1c6fbab9
commit
fd321355d6
1 changed files with 4 additions and 1 deletions
|
@ -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…
Reference in a new issue