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 fails when Satellite uses Simple Content Access #715

Open
Rikairchy opened this issue Jul 30, 2020 · 5 comments
Open

Comments

@Rikairchy
Copy link

Rikairchy commented Jul 30, 2020

SUMMARY

When using redhat_subscription to register hosts with Red Hat Satellite using Simple Content Access, subscription_manager fails with the error "Unable to find available subscriptions for all your installed products."

ISSUE TYPE
  • Bug Report
COMPONENT NAME

redhat_subscription

ANSIBLE VERSION
ansible 2.9.10
  config file = None
  configured module search path = ['/home/mattr/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.8.2 (default, Jul 16 2020, 14:00:26) [GCC 9.3.0]
CONFIGURATION
mattr@controller:~$ ansible-config dump --only-changed
mattr@controller:~$
OS / ENVIRONMENT

Controller: Red Hat Enterprise Linux 7.8
Targets: Red Hat Enterprise Linux 7.8

STEPS TO REPRODUCE
---
- name: Sub to Sat
  hosts: all
  become: "True"

  tasks:
    - name: Subscribe
      redhat_subscription:
        activationkey: "{{ activation_key }}"
        org_id: "{{ org_name }}"
EXPECTED RESULTS
changed: [TARGET_HOST] => {"changed": true, "msg": "System successfully registered to 'https://satellite.mydomain.tld'.", "subscribed_pool_ids": []}
ACTUAL RESULTS
fatal: [TARGET_HOST]: FAILED! => {
    "changed": false,
    "cmd": "/sbin/subscription-manager register --org MYORGNAME--activationkey VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
    "invocation": {
        "module_args": {
            "activationkey": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "auto_attach": null,
            "consumer_id": null,
            "consumer_name": null,
            "consumer_type": null,
            "environment": null,
            "force_register": false,
            "org_id": "MYORGNAME",
            "password": null,
            "pool": "^$",
            "pool_ids": [],
            "release": null,
            "rhsm_baseurl": null,
            "rhsm_repo_ca_cert": null,
            "server_hostname": null,
            "server_insecure": null,
            "server_proxy_hostname": null,
            "server_proxy_password": null,
            "server_proxy_port": null,
            "server_proxy_user": null,
            "state": "present",
            "syspurpose": null,
            "username": null
        }
    },
    "msg": "",
    "rc": 1,
    "stderr": "",
    "stderr_lines": [],
    "stdout": "The system has been registered with ID: <UUID>\nThe registered system name is: rheltemplate\nInstalled Product Current Status:\nProduct Name: Red Hat Enterprise Linux Server\nStatus:       Not Subscribed\n\nUnable to find available subscriptions for all your installed products.\n",
    "stdout_lines": [
        "The system has been registered with ID: <UUID>",
        "The registered system name is: rheltemplate",
        "Installed Product Current Status:",
        "Product Name: Red Hat Enterprise Linux Server",
        "Status:       Not Subscribed",
        "",
        "Unable to find available subscriptions for all your installed products."
    ]
}
TEMPORARY WORKAROUND
---
- name: Sub to Sat
  hosts: all
  become: "True"

  tasks:
    - name: Subscribe
      redhat_subscription:
        activationkey: "{{ activation_key }}"
        org_id: "{{ org_name }}"
      register: rhsm_output
      failed_when: "'The system has been registered' not in rhsm_output.stdout"
@Rikairchy
Copy link
Author

If a host is removed from Satellite and re-subscribed, the workaround is not required. Testing this issue with three machines that were previously enrolled in this instance of Satellite did not result in errors. Adding a fourth VM that has not subscribed to this Satellite instance previously failed with the above error. This bug occurs only during the initial registration of a machine to Satellite using SCA.

@Rikairchy Rikairchy changed the title subscription_manager fails when Satellite uses Simple Content Access redhat_subscription fails when Satellite uses Simple Content Access Jul 31, 2020
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added module module os packaging plugins plugin (any type) labels Jul 31, 2020
@Rikairchy
Copy link
Author

bot_status

@ansibullbot
Copy link
Collaborator

Components

plugins/modules/packaging/os/redhat_subscription.py
support: core
maintainers: alikins barnabycourt kahowell

Metadata

waiting_on: maintainer
needs_info: False

click here for bot help

igramic pushed a commit to igramic/ansible-role-redhat-subscription that referenced this issue Feb 11, 2022
openstack-mirroring pushed a commit to openstack-archive/ansible-role-redhat-subscription that referenced this issue Feb 15, 2022
Change-Id: Idb58eb143b812c16d8cf348f045e0505dea1ce86
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Feb 15, 2022
* Update ansible-role-redhat-subscription from branch 'master'
  to 66a322b0075f57e88bccf79ae3a87eede7a72236
  - addressing ansible-collections/community.general#715
    
    Change-Id: Idb58eb143b812c16d8cf348f045e0505dea1ce86
openstack-mirroring pushed a commit to openstack-archive/ansible-role-redhat-subscription that referenced this issue Feb 15, 2022
This reverts commit 66a322b.

Reason for revert: this needs more work from the author. We agreed on this.

Change-Id: I905598df2379ff2b810d4d9b4032e4eadb873db0
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Feb 15, 2022
* Update ansible-role-redhat-subscription from branch 'master'
  to ae0a36118ad113e808c832e6ea98d435b0d08d71
  - Revert "addressing ansible-collections/community.general#715"
    
    This reverts commit 66a322b0075f57e88bccf79ae3a87eede7a72236.
    
    Reason for revert: this needs more work from the author. We agreed on this.
    
    Change-Id: I905598df2379ff2b810d4d9b4032e4eadb873db0
openstack-mirroring pushed a commit to openstack-archive/ansible-role-redhat-subscription that referenced this issue Feb 21, 2022
Change-Id: I3e8390e68f95621ae6728dd705c554adc6d65866
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Feb 21, 2022
* Update ansible-role-redhat-subscription from branch 'master'
  to 7369c0ba979df60c139cc56695ec3630bd77bd04
  - Fixing ansible-collections/community.general#715
    
    Change-Id: I3e8390e68f95621ae6728dd705c554adc6d65866
@ansibullbot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants