mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
Tweak variable manager use in role includes to avoid test failures
This commit is contained in:
parent
a89412ecb1
commit
dfa33d0f23
3 changed files with 18 additions and 7 deletions
|
@ -159,9 +159,16 @@ class RoleDefinition(Base, Become, Conditional, Taggable):
|
|||
if self._role_basedir:
|
||||
role_search_paths.append(self._role_basedir)
|
||||
|
||||
# now iterate through the possible paths and return the first one we find
|
||||
all_vars = self._variable_manager.get_vars(loader=self._loader, play=self._play)
|
||||
# create a templar class to template the dependency names, in
|
||||
# case they contain variables
|
||||
if self._variable_manager is not None:
|
||||
all_vars = self._variable_manager.get_vars(loader=self._loader, play=self._play)
|
||||
else:
|
||||
all_vars = dict()
|
||||
|
||||
templar = Templar(loader=self._loader, variables=all_vars)
|
||||
|
||||
# now iterate through the possible paths and return the first one we find
|
||||
for path in role_search_paths:
|
||||
path = templar.template(path)
|
||||
role_path = unfrackpath(os.path.join(path, role_name))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue