mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Make sure role deps inherit conditionals/tags specified via params
Fixes #7353
This commit is contained in:
@@ -119,6 +119,16 @@ class Role(Base, Become, Conditional, Taggable):
|
|||||||
if role_include.role not in play.ROLE_CACHE:
|
if role_include.role not in play.ROLE_CACHE:
|
||||||
play.ROLE_CACHE[role_include.role] = dict()
|
play.ROLE_CACHE[role_include.role] = dict()
|
||||||
|
|
||||||
|
if parent_role:
|
||||||
|
if parent_role.when:
|
||||||
|
new_when = parent_role.when[:]
|
||||||
|
new_when.extend(r.when or [])
|
||||||
|
r.when = new_when
|
||||||
|
if parent_role.tags:
|
||||||
|
new_tags = parent_role.tags[:]
|
||||||
|
new_tags.extend(r.tags or [])
|
||||||
|
r.tags = new_tags
|
||||||
|
|
||||||
play.ROLE_CACHE[role_include.role][hashed_params] = r
|
play.ROLE_CACHE[role_include.role][hashed_params] = r
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user