mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Add ansible_parent_role_names magic variable (#46687)
-Add: Test cases for ansible_parent_role_names and ansible_parent_role_paths -Add: ansible_parent_role_names/paths variables for when a role is being included by another role.
This commit is contained in:
@@ -166,4 +166,6 @@ class IncludeRole(TaskInclude):
|
||||
v = super(IncludeRole, self).get_include_params()
|
||||
if self._parent_role:
|
||||
v.update(self._parent_role.get_role_params())
|
||||
v.setdefault('ansible_parent_role_names', []).insert(0, self._parent_role.get_name())
|
||||
v.setdefault('ansible_parent_role_paths', []).insert(0, self._parent_role._role_path)
|
||||
return v
|
||||
|
||||
Reference in New Issue
Block a user