Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redhat_subscription: stop manual unsubscribing on unregistration #9578

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bugfixes:
- |
redhat_subscription - do not try to unsubscribe (i.e. remove subscriptions)
when unregistering a system: newer versions of subscription-manager, as
available in EL 10 and Fedora 41+, do not support entitlements anymore, and
thus unsubscribing will fail
(https://github.com/ansible-collections/community.general/pull/9578).
1 change: 0 additions & 1 deletion plugins/modules/redhat_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,6 @@ def main():
module.exit_json(changed=False, msg="System already unregistered.")
else:
try:
rhsm.unsubscribe()
rhsm.unregister()
except Exception as e:
module.fail_json(msg="Failed to unregister: %s" % to_native(e))
Expand Down
5 changes: 0 additions & 5 deletions tests/unit/plugins/modules/test_redhat_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,6 @@ def test_without_required_parameters_registered(mocker, capfd, patch_redhat_subs
{'check_rc': False},
(0, 'system identity: b26df632-25ed-4452-8f89-0308bfd167cb', '')
),
(
['/testbin/subscription-manager', 'remove', '--all'],
{'check_rc': True},
(0, '', '')
),
(
['/testbin/subscription-manager', 'unregister'],
{'check_rc': True},
Expand Down
Loading