As a user, I have a roles API for published distribution base paths
This basic implementation should create a live API at
/pulp_ansible/galaxy/<distribution.base_path>/roles/ that will provide the minimum functionality for the galaxy client to discover role urls from it.
This work will probably require the addition of a new field (e.g. "url") in the galaxy api format to serve as an alternative to the github_user and github_repo fields. The galaxy cli client will probably need to be updated too.
There will have to be two pages really: one for roles and one for versions. The galaxy cli first looks up roles and then the versions for these roles.
#15 Updated by bmbouter over 3 years ago
- Subject changed from As a user, I can publish a repository version containing Ansible roles in a Galaxy compatible format to As a user, I have a roles API for published distribution base paths
- Description updated (diff)
rewriting based on requirements review w/ daviddavis
#19 Updated by daviddavis over 3 years ago
FYI, we can use GALAXY_SERVER in the ansible cli client config and point it to our pulp instance instead of the public galaxy server.
#20 Updated by daviddavis over 3 years ago
We'll need a change to the ansible galaxy client (which lives in https://github.com/ansible/ansible) to be able to fetch roles from somewhere other than github. I'm imagining that we'll have a url field for roles in which case this should work:
diff --git a/lib/ansible/galaxy/role.py b/lib/ansible/galaxy/role.py index c9d8ddd3eb..7d0765d84f 100644 --- a/lib/ansible/galaxy/role.py +++ b/lib/ansible/galaxy/role.py @@ -167,13 +167,15 @@ 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: # first grab the file and save it to a temp location if "github_user" in role_data and "github_repo" in role_data: archive_url = 'https://github.com/%s/%s/archive/%s.tar.gz' % (role_data["github_user"], role_data["github_repo"], self.version) + elif "url" in role_data: + archive_url = role_data["url"] else: archive_url = self.src
#24 Updated by daviddavis over 3 years ago
Ansible galaxy cli looks up role by
owner__username is just using
#28 Updated by daviddavis about 3 years ago
- % Done changed from 0 to 100
Applied in changeset pulp_ansible|91d53969dc03c0dae6dafd46f309ba6a31bbcbe3.
Please register to edit this issue