From 782c2f75dfaed1837088fbbb653c8b702808689e Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 29 Jul 2015 14:49:08 -0400 Subject: [PATCH] Make sure role deps inherit conditionals/tags specified via params Fixes #7353 --- lib/ansible/playbook/role/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ansible/playbook/role/__init__.py b/lib/ansible/playbook/role/__init__.py index b805555729c..323709bfe88 100644 --- a/lib/ansible/playbook/role/__init__.py +++ b/lib/ansible/playbook/role/__init__.py @@ -119,6 +119,16 @@ class Role(Base, Become, Conditional, Taggable): if role_include.role not in play.ROLE_CACHE: 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 return r