-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
rhsm modules: cleanly fail when not run as root #6211
rhsm modules: cleanly fail when not run as root #6211
Conversation
7b07d8b
to
9eb022f
Compare
subscription-manager on RHEL installs a symlink in /usr/bin to console-helper (part of usermode), which triggers an interactive prompt for root credentials when run as user. It seems that console-helper does not handle well non-interactive contexts (e.g. without a TTY for input), and thus it will hang waiting for input when run as user in an Ansible task. Since subscription-manager requires root already anyway (and it will fail when explicitly run as user), then apply the same logic locally on all the modules that interact with it: redhat_subscription, rhsm_release, and rhsm_repository.
9eb022f
to
6c995c4
Compare
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
Backport to stable-5: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 9f67cbb on top of patchback/backports/stable-5/9f67cbbe36de0c09477a600a2f513e53d81f1274/pr-6211 Backporting merged PR #6211 into main
🤖 @patchback |
@ptoscano thanks for your contribution! |
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #6218 🤖 @patchback |
subscription-manager on RHEL installs a symlink in /usr/bin to console-helper (part of usermode), which triggers an interactive prompt for root credentials when run as user. It seems that console-helper does not handle well non-interactive contexts (e.g. without a TTY for input), and thus it will hang waiting for input when run as user in an Ansible task. Since subscription-manager requires root already anyway (and it will fail when explicitly run as user), then apply the same logic locally on all the modules that interact with it: redhat_subscription, rhsm_release, and rhsm_repository. (cherry picked from commit 9f67cbb)
…n not run as root (#6218) rhsm modules: cleanly fail when not run as root (#6211) subscription-manager on RHEL installs a symlink in /usr/bin to console-helper (part of usermode), which triggers an interactive prompt for root credentials when run as user. It seems that console-helper does not handle well non-interactive contexts (e.g. without a TTY for input), and thus it will hang waiting for input when run as user in an Ansible task. Since subscription-manager requires root already anyway (and it will fail when explicitly run as user), then apply the same logic locally on all the modules that interact with it: redhat_subscription, rhsm_release, and rhsm_repository. (cherry picked from commit 9f67cbb) Co-authored-by: Pino Toscano <ptoscano@redhat.com>
SUMMARY
subscription-manager
on RHEL installs a symlink in/usr/bin
toconsole-helper
(part of usermode), which triggers an interactive prompt for root credentials when run as user. It seems thatconsole-helper
does not handle well non-interactive contexts (e.g. without a TTY for input), and thus it will hang waiting for input when run as user in an Ansible task.Since
subscription-manager
requires root already anyway (and it will fail when explicitly run as user), then apply the same logic locally on all the modules that interact with it:redhat_subscription
,rhsm_release
, andrhsm_repository
.Fixes #734
ISSUE TYPE
COMPONENT NAME
redhat_subscription
ADDITIONAL INFORMATION
A simple reproducer is running any of
redhat_subscription
,rhsm_release
, orrhsm_repository
without any privilege escalation (i.e.become
).