Properly template role dependency names

Fixes #12505
This commit is contained in:
James Cammarata 2015-09-29 09:55:40 -04:00
parent f42f5e6740
commit 79e364d98b
2 changed files with 4 additions and 1 deletions

View file

@ -168,7 +168,7 @@ class Role(Base, Become, Conditional, Taggable):
# load the role's other files, if they exist # load the role's other files, if they exist
metadata = self._load_role_yaml('meta') metadata = self._load_role_yaml('meta')
if metadata: if metadata:
self._metadata = RoleMetadata.load(metadata, owner=self, loader=self._loader) self._metadata = RoleMetadata.load(metadata, owner=self, variable_manager=self._variable_manager, loader=self._loader)
self._dependencies = self._load_dependencies() self._dependencies = self._load_dependencies()
else: else:
self._metadata = RoleMetadata() self._metadata = RoleMetadata()

View file

@ -160,7 +160,10 @@ class RoleDefinition(Base, Become, Conditional, Taggable):
role_search_paths.append(self._role_basedir) role_search_paths.append(self._role_basedir)
# now iterate through the possible paths and return the first one we find # 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)
templar = Templar(loader=self._loader, variables=all_vars)
for path in role_search_paths: for path in role_search_paths:
path = templar.template(path)
role_path = unfrackpath(os.path.join(path, role_name)) role_path = unfrackpath(os.path.join(path, role_name))
if self._loader.path_exists(role_path): if self._loader.path_exists(role_path):
return (role_name, role_path) return (role_name, role_path)