mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 07:31:23 -07:00
Merge 5973a4b279
into 3ad57ffa67
This commit is contained in:
commit
9389e478db
2 changed files with 16 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- redhat_subscription - skip attach operation for OS versions where the attach sub-command has been removed (https://github.com/ansible-collections/community.general/issues/10253, https://github.com/ansible-collections/community.general/pull/10254)
|
|
@ -116,6 +116,8 @@ options:
|
|||
description:
|
||||
- Upon successful registration, auto-consume available subscriptions.
|
||||
- Please note that the alias O(ignore:autosubscribe) was removed in community.general 9.0.0.
|
||||
- Since community.general 11.1.0 resp. 10.7.2, this option does nothing for RHEL 10+ and Fedora 41+ where
|
||||
C(attach) has been removed.
|
||||
type: bool
|
||||
activationkey:
|
||||
description:
|
||||
|
@ -430,6 +432,18 @@ class Rhsm(object):
|
|||
Raises:
|
||||
* Exception - if any error occurs during the registration
|
||||
'''
|
||||
# subscription-manager attach command was removed in Fedora 41 and RHEL 10
|
||||
distro_id = distro.id()
|
||||
try:
|
||||
distro_major_version = int(distro.major_version())
|
||||
except ValueError:
|
||||
distro_major_version = 0
|
||||
if (
|
||||
(distro_id == 'rhel' and distro_major_version >= 10)
|
||||
or (distro_id == 'fedora' and distro_major_version >= 41)
|
||||
):
|
||||
auto_attach = False
|
||||
|
||||
# There is no support for token-based registration in the D-Bus API
|
||||
# of rhsm, so always use the CLI in that case;
|
||||
# also, since the specified environments are names, and the D-Bus APIs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue