diff --git a/lib/ansible/galaxy/api.py b/lib/ansible/galaxy/api.py index 39f4b51703..c6260e3afb 100644 --- a/lib/ansible/galaxy/api.py +++ b/lib/ansible/galaxy/api.py @@ -203,7 +203,7 @@ class GalaxyAPI(object): """ try: - url = '%s/roles/%d/%s/?page_size=50' % (self.baseurl, int(role_id), related) + url = '%s/roles/%s/%s/?page_size=50' % (self.baseurl, role_id, related) data = self.__call_galaxy(url) results = data['results'] done = (data.get('next_link', None) is None) diff --git a/lib/ansible/galaxy/role.py b/lib/ansible/galaxy/role.py index c9d8ddd3eb..a469160930 100644 --- a/lib/ansible/galaxy/role.py +++ b/lib/ansible/galaxy/role.py @@ -167,7 +167,7 @@ class GalaxyRole(object): def fetch(self, role_data): """ - Downloads the archived role from github to a temp location + Downloads the archived role to a temp location based on role data """ if role_data: @@ -242,6 +242,11 @@ class GalaxyRole(object): self.name, role_versions)) + # check if there's a source link for our role_version + for role_version in role_versions: + if role_version['name'] == self.version and 'source' in role_version: + self.src = role_version['source'] + tmp_file = self.fetch(role_data) else: