Bug 2180803

Summary: [RFE] Foreman-maintain health check should check hostname
Product: Red Hat Satellite Reporter: Vedashree Deshpande <vdeshpan>
Component: Foreman MaintainAssignee: satellite6-bugs <satellite6-bugs>
Status: NEW --- QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.10.0CC: dsinglet, ehelms, saydas
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Vedashree Deshpande 2023-03-22 11:06:58 UTC
Description of problem:
As of now, we do not check in health check if Satellite FQDN is set or not. So before configuring new  DNS, DHCP or updating certificates we should have foreman-maintain health check run and it should check proper FQDN. 

Version-Release number of selected component (if applicable):
6.10 onward

Actual results:
# foreman-maintain health check
Running ForemanMaintain::Scenario::FilteredScenario
================================================================================
Clean old Kernel and initramfs files from tftp-boot:                  [OK]
--------------------------------------------------------------------------------
Check number of fact names in database:                               [OK]
--------------------------------------------------------------------------------
Check whether all services are running:                               [OK]
--------------------------------------------------------------------------------
Check whether all services are running using the ping call:           [OK]
--------------------------------------------------------------------------------
Check for paused tasks:                                               [OK]
--------------------------------------------------------------------------------
Check to verify no empty CA cert requests exist:                      [OK]
--------------------------------------------------------------------------------
Check whether system is self-registered or not:                       [OK]
--------------------------------------------------------------------------------

Expected results:
It should include hostname check. 

Additional info:

Comment 1 Vedashree Deshpande 2023-03-22 11:41:37 UTC
We can check and verify the outputs of

$ hostnamectl status
$ ping -c1 hostname -f
$ ping -c1 localhost

Comment 3 Sayan Das 2023-05-09 15:34:11 UTC
I was discussing this BZ with Vedashree as I was a bit confused. But after discussing with her, I believe the right intention here is :

* A hostname check should be included in the foreman_maintain's health check code:

* The *check* should be able to 

  * Check the current FQDN
  * Check the FQDN recognized by satellite ( i.e. in the configuration of satellite )
  * Verify that both FQDN matches with each other
  * If they don't, print both the FQDNs and request user to fix that mismatch. 

In that way, A manual OS level change in FQDN or change in the domain of the host can be easily detected.