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

[PR #6259/c9e11e5c backport][stable-6] redhat_subscription: manually unregister only when registered #6280

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Apr 3, 2023

This is a backport of PR #6259 as merged into main (c9e11e5).

SUMMARY

When registering using D-Bus and using a version of subscription-manager with an unimplemented force option, then unregister manually the system only if it is registered. subscription-manager unregister errors out when trying to unregister an already unregistered system.

Fixes #6258

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

redhat_subscription

ADDITIONAL INFORMATION

Easy reproducer:

  • RHEL 9 older than 9.2, or RHEL 8 older than 8.8, or RHEL 7 and older
  • ensure the system is unregistered, and attempt to register with force_register=true
- name: ensure unregistered
  redhat_subscription:
    state: absent

- name: ensure registered
  redhat_subscription:
    state: present
    force_register: true
    username: "your-username"
    password: "your-password"
    # or activationkey + org_id instead of username + password

When registering using D-Bus and using a version of subscription-manager
with an unimplemented 'force' option, then unregister manually the
system only if it is registered. 'subscription-manager unregister'
errors out when trying to unregister an already unregistered system.

(cherry picked from commit c9e11e5)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor os packaging plugins plugin (any type) needs_maintainer labels Apr 3, 2023
@felixfontein felixfontein merged commit 43beaf4 into stable-6 Apr 3, 2023
@felixfontein felixfontein deleted the patchback/backports/stable-6/c9e11e5c0c636aefdfdd985d58cfbea4bec42f7f/pr-6259 branch April 3, 2023 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module needs_maintainer new_contributor Help guide this first time contributor os packaging plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants