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):
...
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.
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
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): ...