Issue #3818
closed
The AnsibleRole as a content unit is problematic
Status:
CLOSED - CURRENTRELEASE
Description
A couple example problems:
- Orphan cleanup will probably remove AnsibleRole records
- Users can add AnsibleRoles (instead of AnsibleRoleVersions) to a content view
Make AnsibleRole not extend Content.
- Triaged changed from No to Yes
- Description updated (diff)
- Groomed changed from No to Yes
- Related to Issue #4653: Orphan cleanup fails for some model types due to database cascade PROTECTED options added
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
Currently our endpoints for roles and role versions are:
/pulp/api/v3/content/ansible/roles/
/pulp/api/v3/content/ansible/roles/1/
/pulp/api/v3/content/ansible/roles/1/versions/
/pulp/api/v3/content/ansible/roles/1/versions/1/
If role is no longer Content, what should the new endpoints be?
Do we maybe just go with role and have version be a field and consolidate on 1 model?
When you install a role version with the ansible galaxy cli, it performs these steps:
1. First it gets the role pk from GET /api/v1/roles/ owner__username=... name=...
2. Then it queries a list of versions from /api/v1/roles/<role_pk>/versions/
3. It looks at these versions and downloads either the newest one or whichever one the user specified
Any thoughts on how to support this without a role pk?
Well this explains why we modeled it this way I guess. So going back to the two-model option, we would end up making one of them a Viewset since it wouldn't be provided through Content's Master/Detail?
I suppose so. Another option would be just have a content viewset for AnsibleRoleVersions and not expose Roles to users. They would have no way to CRUD roles but it would be an easy/simple solution.
I think we want DRF to do the CRUD. And overall having these related models was making it more complex for DRF to provide basic CRUD for this type.
- Status changed from ASSIGNED to POST
- Status changed from POST to MODIFIED
- Related to Test #4756: Test sync from galaxy.ansible.com added
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Combining role and role version into a single content unit
https://pulp.plan.io/issues/3818 fixes #3818