Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1644887

Summary: Adding CDS fails with fatal error due to not prompting for sudo password on yum install
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Paul Dudley <pdudley>
Component: DocumentationAssignee: Radek Bíba <rbiba>
Status: CLOSED COMPLETED QA Contact: Radek Bíba <rbiba>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.10CC: bkearney, gtanzill, jalviso, ktordeur, mkalyat, mminar, mshimura, syamamot
Target Milestone: ---Keywords: PrioBumpField, Triaged
Target Release: 4.x   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-11-22 07:19:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Paul Dudley 2018-10-31 19:51:53 UTC
Description of problem:

Adding a CDS fails with the following output:

===
Checking that the RHUA services are reachable from the instance...
[rhuicds.net] sudo: yum install -d 0 -e 0 -y nc
[rhuicds.net] out: sudo password:
Fatal error: Needed to prompt for a connection or sudo password (host: rhuicds.net), but abort-on-prompts was set to True

Aborting.

Something happened, check the log file for more information: ~/.rhui/rhui.log
===

No information was recorded in /var/log/secure regarding password failures. This was the third CDS install on this RHUA, the other two CDSs did not hit this problem. This problem was remedied by adding passwordless sudo to the sudoers file on the CDS for the rhuicds user.


How reproducible:
Not reproduced reliably

Steps to Reproduce:
1. Install RHUA and CDS 
2. Create user for CDS 
3. Enter different user other than root to install CDS when prompted in rhui-manager

Actual results:
The user is not prompted for the password for the rhuicds user

Expected results:
The user is prompted for the password

Comment 3 Sagar Lutade 2019-01-10 08:17:22 UTC
We can bypass this by setting passwordless login from the user which you are trying to add CDS.
Also by adding the user and setting NOPASSWD.

# ssh-copy-id user@CDS
# ssh-keyscan -H user@CDS >> ~/.ssh/known_hosts           ======> Adding CDS as trusted with RHUA.

Then try adding the CDS again.

Comment 7 Radek Bíba 2022-05-25 15:21:25 UTC
The code that used to run "yum install -d 0 -e 0 -y nc" with sudo doesn't exist in RHUI 4.0+ because the use of paramiko/fabric was replaced with Ansible playbooks. That said, it is still necessary to use NOPASSWD in sudo configuration, or else node registration fails like this:

May 25 15:08:58 ip-10-103-223-103 sudo[14890]: **USER** : a password is required ; TTY=pts/1 ; PWD=/home/**USER** ; USER=root ; COMMAND=/bin/sh -c echo BECOME-SUCCESS-asgxmjirqxhwlfimvzatjaxtnnzcvpwh ; /usr/libexec/platform-python /home/**USER**/.ansible/tmp/ansible-tmp-1653491338.2099364-43364-176605629361190/AnsiballZ_setup.py

(this is from /var/log/secure on the CDS)

Comment 11 Radek Bíba 2024-11-22 07:19:20 UTC
Chapter 3. Technical configuration required for installing RHUI has been updated.

Comment 12 Radek Bíba 2024-11-22 07:31:20 UTC
*** Bug 2152719 has been marked as a duplicate of this bug. ***

Comment 13 Radek Bíba 2024-11-22 07:37:40 UTC
*** Bug 2322898 has been marked as a duplicate of this bug. ***