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 1967649 - The redhat.satellite.external_usergroup module will always use the name of satellite usergroup in the backend api call instead of id.
Summary: The redhat.satellite.external_usergroup module will always use the name of sa...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible Collection
Version: 6.9.0
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: 6.10.0
Assignee: Evgeni Golov
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-03 14:22 UTC by Sayan Das
Modified: 2024-10-01 18:27 UTC (History)
4 users (show)

Fixed In Version: ansible-collection-redhat-satellite-2.1.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:11:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman-ansible-modules pull 1239 0 None closed always lookup the ID of the usergroup 2021-07-22 18:31:55 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:12:00 UTC

Description Sayan Das 2021-06-03 14:22:24 UTC
Description of problem:

When using redhat.satellite.external_usergroup module to map an AD usergroup with Satellite usergroup, it calls for following API  --> GET /api/usergroups/:usergroup_id/external_usergroups 

To have that API properly working ":usergroup_id" should be the usergroup ID of satellite but instead the module always use the name of the group instead of ID.


Version-Release number of selected component (if applicable):

Satellite 6.9

Satellite Ansible collection 


How reproducible:

Always


Steps to Reproduce:
1. Build a Satellite 6.9

2. Create a usergroup by name "043-enterprise systems" in Satellite and Create an AD auth-source by name "AD-RedHat". Consider that there is a "043-enterprise systems" group present in AD which we want to map with satellite usergroup "043-enterprise systems" 

3. Write a play to use "redhat.satellite.external_usergroup" to map "043-enterprise systems" group present in AD with satellite usergroup "043-enterprise systems" 

4. Check /var/log/foreman/production.log in satellite during the playbook execution


Actual results:

Step 3 error:
~~
  ansible_loop_var: item
  error:
    message: Resource external_usergroup not found by id ''
  item:
    name: 043-enterprise systems
    usergroup: 043-enterprise systems
  msg: 'Failed to list resource: HTTPError: 404 Client Error: Not Found'

~~


Step 4 logs from satellite shows how the API is used:
~~
2021-06-03T19:06:14 [I|app|7a0d9e55] Started GET "/api/usergroups/043-enterprise%20systems/external_usergroups" for 10.74.130.249 at 2021-06-03 19:06:14 +0530
2021-06-03T19:06:14 [I|app|7a0d9e55] Processing by Api::V2::ExternalUsergroupsController#index as JSON
2021-06-03T19:06:14 [I|app|7a0d9e55]   Parameters: {"apiv"=>"v2", "usergroup_id"=>"043-enterprise systems"}
2021-06-03T19:06:14 [I|app|7a0d9e55]   Rendering api/v2/errors/not_found.json.rabl within api/v2/layouts/error_layout
~~


Expected results:

Step 3 should be successful and use the ID of the group instead of the name in the API call.


Additional info:

The patch https://gist.github.com/evgeni/8102eef7e1b53bc4a17d3d653f538378 for the redhat.satellite.external_usergroup , fixes this issue.

Comment 5 errata-xmlrpc 2021-11-16 14:11:38 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 (Moderate: Satellite 6.10 Release), 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-2021:4702


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