Issue #3818
closedThe AnsibleRole as a content unit is problematic
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.
Related issues
Updated by bmbouter over 5 years ago
- Related to Issue #4653: Orphan cleanup fails for some model types due to database cascade PROTECTED options added
Updated by daviddavis over 5 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
Updated by daviddavis over 5 years ago
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?
Updated by bmbouter over 5 years ago
Do we maybe just go with role and have version be a field and consolidate on 1 model?
Updated by daviddavis over 5 years ago
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?
Updated by bmbouter over 5 years ago
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?
Updated by daviddavis over 5 years ago
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.
Updated by bmbouter over 5 years ago
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.
Updated by daviddavis over 5 years ago
- Status changed from ASSIGNED to POST
Added by daviddavis over 5 years ago
Updated by daviddavis over 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp_ansible|ea5135e7aba4d539f0f8cd6b5ee4e9412666f5a4.
Updated by kersom over 5 years ago
- Related to Test #4756: Test sync from galaxy.ansible.com added
Updated by bmbouter about 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Combining role and role version into a single content unit
https://pulp.plan.io/issues/3818 fixes #3818