Bug 2164400 - [RFE] Add functionality in API (to match Hammer) to Add/Delete a single Ansible role to Hostgroup without defining every role.
Summary: [RFE] Add functionality in API (to match Hammer) to Add/Delete a single Ansib...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible
Version: 6.9.7
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: 6.14.0
Assignee: Oleh Fedorenko
QA Contact: Gaurav Talreja
Adam Lazik
URL:
Whiteboard:
Depends On: 2029402
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-25 13:34 UTC by mark yarborough
Modified: 2023-07-10 19:14 UTC (History)
16 users (show)

Fixed In Version: rubygem-foreman_ansible-12.0.3
Doc Type: Enhancement
Doc Text:
.You can now add or remove single Ansible role to host or host group through API You can use the new API endpoints to manage Ansible roles on hosts or host groups. To add a role, use the PUT HTTP method. To remove a role, use the DELETE HTTP method. * To manage Ansible roles of a host, use `api/v2/hosts/:id/ansible_roles/:ansible_role_id`. * To manage ansible roles of a host group, use `api/v2/hostgroups/:id/ansible_roles/:ansible_role_id`. Replace `:id` with the ID of your host or host group and `:ansible_role_id` with the ID of the Ansible role that you wish to add or remove.
Clone Of: 2029402
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36015 0 Normal New Add functionality in API (to match Hammer) to Add/Delete a single Ansible role to Hostgroup without defining every role.... 2023-01-27 14:13:53 UTC
Foreman Issue Tracker 36413 0 Normal Ready For Testing Add a single role doesn't follow REST specs 2023-05-18 14:03:32 UTC
Red Hat Issue Tracker SAT-15133 0 None None None 2023-01-25 13:37:09 UTC

Comment 2 Oleh Fedorenko 2023-01-27 14:13:52 UTC
Created redmine issue https://projects.theforeman.org/issues/36015 from this bug

Comment 3 Bryan Kearney 2023-01-27 16:03:39 UTC
Upstream bug assigned to ofedoren

Comment 4 Bryan Kearney 2023-01-27 16:03:41 UTC
Upstream bug assigned to ofedoren

Comment 6 Bryan Kearney 2023-05-08 16:04:04 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36015 has been resolved.

Comment 13 Gaurav Talreja 2023-05-31 19:32:14 UTC
Verified.

Tested on Satellite 6.14.0 Snap 1.0
Version: rubygem-foreman_ansible-12.0.3-1.el8sat.noarch

Steps:
1. Create a Host/HostGroup
2. Import/Sync ansible_roles, and assign a few roles to Host/HostGroup
3. For add and remove ansible_roles for the HostGroup endpoints run "PUT /api/hostgroups/:id/ansible_roles/:ansible_role_id" and "DELETE /api/hostgroups/:id/ansible_roles/:ansible_role_id",
And for add and remove ansible_roles to Host endpoints run "PUT /api/hosts/:id/ansible_roles/:ansible_role_id" and "DELETE /api/hosts/:id/ansible_roles/:ansible_role_id"

Observation:
Add and remove API endpoints works fine for adding and removing single ansible_role with :ansible_role_id to Host/HostGroup.


Note You need to log in before you can comment on or make changes to this bug.