Commit 782c2f75 by James Cammarata

Make sure role deps inherit conditionals/tags specified via params

Fixes #7353
parent bedfe00d
...@@ -119,6 +119,16 @@ class Role(Base, Become, Conditional, Taggable): ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment