1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge role params into variables separately from other variables

Fixes #13617
This commit is contained in:
Yannig Perré 2015-12-21 13:01:58 -05:00 committed by James Cammarata
parent e957335b0d
commit a4674906c6
2 changed files with 7 additions and 0 deletions

View file

@ -265,6 +265,12 @@ class Role(Base, Become, Conditional, Taggable):
inherited_vars = combine_vars(inherited_vars, parent._role_params)
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):
all_vars = self.get_inherited_vars(dep_chain, include_params=include_params)

View file

@ -308,6 +308,7 @@ class VariableManager:
if not C.DEFAULT_PRIVATE_ROLE_VARS:
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))
if task: