mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
[PR #9578/bcc92e8a backport][stable-10] redhat_subscription: stop manual unsubscribing on unregistration (#9590)
redhat_subscription: stop manual unsubscribing on unregistration (#9578)
Unregistering a system also drops all the resources for it
automatically, so there is no need to manually unsubscribing (which
actually means removing all the subscriptions).
In addition to that, newer versions of subscription-manager drop all the
support for entitlements, so the "remove" subcommand (used by
unsubscribe()) does not exist anymore, and thus the unregistration fails
with those versions.
This fixes the registration on EL 10 systems, and Fedora 41 and greater.
(cherry picked from commit bcc92e8aac
)
Co-authored-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
parent
4476a4bb1c
commit
add595e121
3 changed files with 7 additions and 6 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue