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 2118248

Summary: Un-handled error by role redhat.satellite.repositories when enabling a repository which is already enabled.
Product: Red Hat Satellite Reporter: Ahmed Eladawy <aeladawy>
Component: Ansible CollectionAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.10.7CC: egolov, ehelms
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-31 17:24:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ahmed Eladawy 2022-08-15 08:18:50 UTC
Description of problem:

When using role redhat.satellite.repositories to enable a repository , if the repository is already enabled , the task is failed with the following error :

failed: [localhost] (item=[{u'name': u'Red Hat Enterprise Linux for x86_64'}, {u'arch': u'noarch', u'releasever': 8, u'name': u'Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)'}]) => {"ansible_loop_var": "item", "changed": false, "error": {"displayMessage": "The repository is already enabled", "errors": ["The repository is already enabled"]}, "item": [{"name": "Red Hat Enterprise Linux for x86_64"}, {"arch": "noarch", "name": "Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)", "releasever": 8}], "msg": "Error while performing enable on repository_sets: 409 Client Error: Conflict"}


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

Satellite 6.10.7
Satellite Ansible collection 3.3.0.

How reproducible:

Not be able to reproduce , only happening with the customer.


Actual results:

Failed task because the repository is already enabled.

Expected results:

The task should not be failed as Ansible is supposed to be idempotent.

Comment 1 Evgeni Golov 2022-08-15 14:42:12 UTC
This is not so much a bug in the Ansible Collection, but in the Satellite API, as reported in https://bugzilla.redhat.com/show_bug.cgi?id=1919321

You probably can't reproduce because you have a fresh system, vs the original reporter having an old system where the repository was created *before* the change to the data structure was made.

Comment 4 Eric Helms 2023-07-31 17:24:03 UTC

*** This bug has been marked as a duplicate of bug 1919321 ***