Created redmine issue https://projects.theforeman.org/issues/36015 from this bug
Upstream bug assigned to ofedoren
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36015 has been resolved.
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.