mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-14 13:09:11 -07: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:
parent
b442706b54
commit
a9f24e097f
9 changed files with 135 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue