Description
Summary
Problem
When executed on an RHEL 10.0 system, the redhat_subscription
module fails when auto_attach
is set to true
. The module attempts to execute /usr/sbin/subscription-manager attach --auto
, but this command exits with return code 1 and prints the usage text for subscription-manager
.
Evaluation
The root cause is fairly obvious. There's no subscription-manager attach
option in RHEL 10, which has simplified registration to a single register
step. In RHEL 9 and earlier, subscribing could require separate register
and attach
commands.
Workaround
Setting auto_attach
to false
allows for correct registration of RHEL 10 systems. Unless the redhat_subscription
module is updated to ignore the auto_attach
option for RHEL 10+, users will need to avoid setting auto_attach
to true
when registering RHEL 10 systems.
Issue Type
Bug Report
Component Name
redhat_subscription
Ansible Version
ansible [core 2.18.6]
config file = None
configured module search path = ['/home/dvanderveer/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/dvanderveer/community.general/lib/python3.12/site-packages/ansible
ansible collection location = /home/dvanderveer/.ansible/collections:/usr/share/ansible/collections
executable location = /home/dvanderveer/venvs/community.general/bin/ansible
python version = 3.12.3 (main, Feb 4 2025, 14:48:35) [GCC 13.3.0] (/home/dvanderveer/venvs/community.general/bin/python3)
jinja version = 3.1.6
libyaml = True
Community.general Version
Collection Version
----------------- -------
community.general 10.7.0
Configuration
CONFIG_FILE() = None
GALAXY_SERVERS:
OS / Environment
RHEL 10.0
Steps to Reproduce
---
- hosts: all
gather_facts: false
tasks:
- name: RHEL register
community.general.redhat_subscription:
auto_attach: true
password: "<password>"
state: present
username: "<username>"
Expected Results
RHEL registration succeeds.
Actual Results
<hostname> | FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python3.12"
},
"changed": false,
"cmd": "/usr/sbin/subscription-manager attach --auto",
"msg": "",
"rc": 1,
"stderr": "",
"stderr_lines": [],
"stdout": "<snip>",
"stdout_lines": [
"Usage: subscription-manager MODULE-NAME [MODULE-OPTIONS] [--help]",
"",
"Primary Modules: ",
"",
" list List subscription and product information for this system",
" refresh Pull the latest subscription data from the server",
" register Register this system to the Customer Portal or another subscription management service",
" release Configure which operating system release to use",
" status Show status information for this system",
" unregister Unregister this system from the Customer Portal or another subscription management service",
"",
"Other Modules: ",
"",
" clean Remove all local system and subscription data without affecting the server",
" config List, set, or remove the configuration parameters in use by this system",
" environments Display the environments available for a user",
" facts View or update the detected system information",
" identity Display the identity certificate for this system or request a new one",
" orgs Display the organizations against which a user can register a system",
" plugins View and configure with 'subscription-manager plugins'",
" repo-override Manage custom content repository settings",
" repos List the repositories which this system is entitled to use",
" syspurpose Convenient module for managing all system purpose settings",
" version Print version information",
""
]
}
Code of Conduct
- I agree to follow the Ansible Code of Conduct