Merge role params into variables separately from other variables

Fixes #13617
pull/13663/head
Yannig Perré 9 years ago committed by James Cammarata
parent 8eb3963cd9
commit 1d18964daa

@ -265,6 +265,12 @@ class Role(Base, Become, Conditional, Taggable):
inherited_vars = combine_vars(inherited_vars, parent._role_params) inherited_vars = combine_vars(inherited_vars, parent._role_params)
return inherited_vars return inherited_vars
def get_role_params(self):
params = {}
for dep in self.get_all_dependencies():
params = combine_vars(params, dep._role_params)
return params
def get_vars(self, dep_chain=[], include_params=True): def get_vars(self, dep_chain=[], include_params=True):
all_vars = self.get_inherited_vars(dep_chain, include_params=include_params) all_vars = self.get_inherited_vars(dep_chain, include_params=include_params)

@ -308,6 +308,7 @@ class VariableManager:
if not C.DEFAULT_PRIVATE_ROLE_VARS: if not C.DEFAULT_PRIVATE_ROLE_VARS:
for role in play.get_roles(): for role in play.get_roles():
all_vars = combine_vars(all_vars, role.get_role_params())
all_vars = combine_vars(all_vars, role.get_vars(include_params=False)) all_vars = combine_vars(all_vars, role.get_vars(include_params=False))
if task: if task:

Loading…
Cancel
Save