Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2164400

Summary: [RFE] Add functionality in API (to match Hammer) to Add/Delete a single Ansible role to Hostgroup without defining every role.
Product: Red Hat Satellite Reporter: mark yarborough <myarboro>
Component: Ansible - Configuration ManagementAssignee: Oleh Fedorenko <ofedoren>
Status: CLOSED ERRATA QA Contact: Gaurav Talreja <gtalreja>
Severity: medium Docs Contact: Adam Lazik <alazik>
Priority: unspecified    
Version: 6.9.7CC: alazik, apatel, aruzicka, bangelic, gtalreja, inecas, kgaikwad, lstejska, momran, nalfassi, oezr, ofedoren, pcreech, rabajaj, rkarimpa, rlavi
Target Milestone: 6.14.0Keywords: EasyFix, FutureFeature, Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rubygem-foreman_ansible-12.0.3 Doc Type: Enhancement
Doc Text:
.New API endpoints have been introduced The following API endpoints have been added: api/v2/hosts/:id/ansible_roles/:ansible_role_id:: Send a GET request to add a single Ansible role to a host or send a DELETE request to remove a single Ansible role from a host. api/v2/hostgroups/:id/ansible_roles/:ansible_role_id:: Send a GET request to add a single Ansible role to a host group or send a DELETE request to remove a single Ansible role from a host group. api/v2/organizations/:organization_id/rh_cloud/missing_hosts:: Send a GET request to list hosts that are missing in Red Hat Cloud. api/v2/webhooks/:id/test:: Send a POST request to test-fire a webhook.
Story Points: ---
Clone Of: 2029402 Environment:
Last Closed: 2023-11-08 14:18:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2029402    
Bug Blocks:    

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.

Comment 18 errata-xmlrpc 2023-11-08 14:18:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.14 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6818