-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
bugThis issue/PR relates to a bugThis issue/PR relates to a bugmodulemodulemodulepluginsplugin (any type)plugin (any type)
Description
Summary
rhsm_repostiroy fails when I do:
- name: Disable repository on Red Hat server
community.general.rhsm_repository:
name:
- "stupid_and_inexistent_dummy_repo_blablabal_randomdfkjsdvoicxjvfdsfsdfp"
state: disabled
become: true
Is it really a good idea?
I mean: if I want to disable a repo on a server, isn't it good enough if rhsm_repository doesn't find it?
sidenote: though deprecated, state can still be "absent", in which case I definitively would classify this failure as a bug.
Issue Type
Bug Report
Component Name
rhsm_repository
Ansible Version
$ ansible --version
ansible [core 2.16.14]
python version = 3.12.11 (main, Aug 15 2025, 13:38:57) [GCC 8.5.0 20210514 (Red Hat 8.5.0-28)]
jinja version = 3.1.6
libyaml = TrueCommunity.general Version
$ ansible-galaxy collection list community.general
Collection Version
----------------- -------
community.general 7.5.9related code is still in master though:
for repoid in matched_existing_repo:
if len(matched_existing_repo[repoid]) == 0:
results.append(f"{repoid} is not a valid repository ID")
module.fail_json(results=results, msg=f"{repoid} is not a valid repository ID")
Configuration
$ ansible-config dump --only-changed
sorry sensitive informationOS / Environment
Red Hat Enterprise Linux release 8.10 (Ootpa)
Steps to Reproduce
- name: Disable repository on Red Hat server
community.general.rhsm_repository:
name:
- "stupid_and_inexistent_dummy_repo_blablabal_randomdfkjsdvoicxjvfdsfsdfp"
state: disabled
become: true
Expected Results
community.general.rhsm_repository should not fail when it doesn't find a repo and state is "disabled" or "absent"
Actual Results
output:
msg:
stupid_and_inexistent_dummy_repo_blablabal_randomdfkjsdvoicxjvfdsfsdfp is not a valid repository IDCode of Conduct
- I agree to follow the Ansible Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugThis issue/PR relates to a bugThis issue/PR relates to a bugmodulemodulemodulepluginsplugin (any type)plugin (any type)