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.
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.
*** This bug has been marked as a duplicate of bug 1919321 ***