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 ***