Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1677872 - Restarting the satellite services is complaining about admin password in hammer configuration
Summary: Restarting the satellite services is complaining about admin password in hamm...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.5.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: 6.9.0
Assignee: Anurag Patel
QA Contact: Gaurav Talreja
URL:
Whiteboard:
Depends On: 1897360 1925616
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-16 14:23 UTC by Kenny Tordeurs
Modified: 2021-04-21 14:48 UTC (History)
9 users (show)

Fixed In Version: rubygem-foreman_maintain-0.4.5
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-21 14:48:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:1312 0 None None None 2021-04-21 14:48:34 UTC

Description Kenny Tordeurs 2019-02-16 14:23:52 UTC
Description of problem:

Restarting the satellite services is complaining about admin password in hammer configuration:

# whoami
~~~
root
~~~

# foreman-maintain service restart
~~~
Running preparation steps required to run the next scenarios
================================================================================
Setup hammer: 
Configuring Hammer CLI...
Hammer admin password: 
                                                                      [FAIL]
Hammer configuration failed: Is the admin password correct? (it was stored in /etc/foreman-maintain/foreman-maintain-hammer.yml)Is the server down?
--------------------------------------------------------------------------------
Scenario [preparation steps required to run the next scenarios] failed.

The following steps ended up in failing state:

  [hammer-setup]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="hammer-setup"
~~~

Also not sure about the combination that should be used to whitelist the hammer-setup:

# foreman-maintain service restart --whitelist="hammer-setup"
~~~
ERROR: Unrecognised option '--whitelist'

See: 'foreman-maintain service restart --help'
~~~

# cat /etc/foreman-maintain/foreman-maintain-hammer.yml
~~~
---
:foreman:
  :username: admin
  :password: password
~~~

[root@ktordeur-sat65 ~]# hammer -u admin -p password host list
~~~
---|-----------------------------------------------|------------------|---------------|---------------|-------------------|---------------|----------------------|----------------------
ID | NAME                                          | OPERATING SYSTEM | HOST GROUP    | IP            | MAC               | GLOBAL STATUS | CONTENT VIEW         | LIFECYCLE ENVIRONMENT
---|-----------------------------------------------|------------------|---------------|---------------|-------------------|---------------|----------------------|----------------------
4  | floyd-mclaird.sysmgmt.lan                     | RHEL Server 7.6  | RHEL7 clients | 192.168.1.138 | 52:54:00:eb:bf:06 | Warning       | RHEL7 Server Clients | Library              
2  | ktordeur-capsule-sat65.sysmgmt.lan            | RHEL Server 7.6  |               | 10.37.193.179 | 52:54:00:70:09:0b | Warning       | CAPSULE              | Library              
1  | ktordeur-sat65.sysmgmt.lan                    | RHEL Server 7.6  |               | 192.168.1.2   | 52:54:00:e1:c9:9b | OK            |                      |                      
3  | virt-who-dell-r440-05.gsslab.brq.redhat.com-1 |                  |               |               |                   | OK            |                      |                      
---|-----------------------------------------------|------------------|---------------|---------------|-------------------|---------------|----------------------|----------------------
~~~

Version-Release number of selected component (if applicable):
6.5 snap 15

How reproducible:
100%

Steps to Reproduce:
1. # foreman-maintain service restart
2.
3.

Actual results:
hammer configuration error for password

Expected results:
Services to be restarted without any hammer config as we are root user

Additional info:
This issue does not happen if we authenticate first with `hammer auth login`

[root@ktordeur-sat65 ~]# hammer auth login
[Foreman] Username: admin
[Foreman] Password for admin: 
Successfully logged in as 'admin'.


[root@ktordeur-sat65 ~]# foreman-maintain service restart
Running Restart Services
================================================================================
Check if command is run as root user:                                 [OK]
--------------------------------------------------------------------------------
Restart applicable services: 
Stopping the following service(s):
...

Comment 3 Nikhil Kathole 2019-06-18 08:54:48 UTC
Similar to https://bugzilla.redhat.com/show_bug.cgi?id=1696862

Comment 6 Gaurav Talreja 2020-12-30 08:12:07 UTC
Verified.

Tested on the latest Satellite 6.9.0 snap 7.0, where blocker candlepin issue was not observed.
Version: rubygem-foreman_maintain-0.7.0-1.el7sat.noarch

Steps:

1. Have invalid passwords in .hammer/cli.modules.d/foreman.yml and /etc/foreman-installer/scenarios.d/satellite-answers.yaml
2. Run "foreman-maintain health check", which prompts for hammer password and generates file /etc/foreman-maintain/foreman-maintain-hammer.yml
3. Have an invalid password in /etc/foreman-maintain/foreman-maintain-hammer.yml
4. Run "foreman-maintain service restart" and all services restart successfully without asking for a hammer password.

Comment 9 errata-xmlrpc 2021-04-21 14:48:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Satellite 6.9 Satellite Maintenance Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1312


Note You need to log in before you can comment on or make changes to this bug.