Bug 1034350

Summary: We should warn users when installing on host without FQDN set
Product: Red Hat Satellite Reporter: Lukas Zapletal <lzap>
Component: InstallerAssignee: Katello Bug Bin <katello-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Tazim Kolhar <tkolhar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.2CC: bkearney, cwelton, tkolhar
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:07:00 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:

Description Lukas Zapletal 2013-11-25 16:32:08 UTC
We have a report from a customer that installed on a server that has not FQDN hostname set. That means:

# hostname
abc

# hostname -f
abc.example.com

Since katello-configure is using gethostname call (via Ruby) to get the FQDN, it configures everything with "abc" in this case. But the customer has a valid DNS entry for this server in the domain, so when the web is accessed via (also correctly set) FQDN (abc.example.com), we are having issues with Signo and signin process.

It is totally fine to install Satellite6 on a host that is not in any domain. But the user must be aware the server is out of any DNS domain and it is not able to join any domain later, because all certificates and everything is being generated during the installation for the given hostname (without domain). Also Signo and other things (OpenID) that depends on hostnames will not work properly.

The fix should be in katello-configure (and making sure foreman-configure does the same thing for MDP3): 

In our installer codebase we are calling gethostname(2) to determine the
FQDN and then we carry on with the whole installation. What we should 
probably do would be to call gethostbyname(3) giving it the hostname 
received by gethostname(2) to consult DNS to get the full FQDN before 
going on. Something like:

>> Socket.gethostname
=> "abc"
>> Socket.gethostbyname(Socket.gethostname)
=> ["abc.brq.redhat.com", [], 2, "\n\"\x01 "]
>> Socket.gethostbyname(Socket.gethostname)[0]
=> "abc.brq.redhat.com"

The code should issue a big warning if domain part is not found. It should warn that server outside of DNS domain is okay, but it cannot join domain later on. This should be very explicit, like a confirmation should be required on an interactive console (Type YES to continue).

We must not force customers to configure hostname with FQDN if they do not want to do this. Also, there still should be a way to configure sat6 without DNS (with only /etc/hosts set properly) and on a server that is not part of any domain.

Also if a user is using server without DNS (only with /etc/hosts), the warning will be shown if hosts FQDN order is incorrect (for more info see my older blog post: http://lukas.zapletalovi.com/2011/12/setting-hostname-properly-in-fedora-and.html).

We have implemented an extra checker that investigates reverse DNS entry (not part of the MDP2): https://bugzilla.redhat.com/show_bug.cgi?id=978828 but this is a different issue.

VERIFY: To verify this bug, install sat6 on both scenarios:

- on a box that has no domain set and is not in DNS
- on a box that has no domain set and is in DNS (fqdn points to the server)

In both scenarios warning should be issued, but sat6 installation whould work properly (login, logout, sync a content).

Comment 1 Lukas Zapletal 2013-11-25 16:41:35 UTC
Also we need to check if hostname can be reverted to non-FQDN hostname after installation is done. We might have some gethostname(2) calls in our runtime code that would start returning incorrect results.

Comment 2 Lukas Zapletal 2013-11-25 16:51:17 UTC
Correcting VERIFY part:

To verify this bug, install sat6 on both scenarios:

- on a box that has no domain set and is not in DNS
- on a box that has no domain set and is in DNS (fqdn points to the server)

In the former scenario, a warning should be issued. In both cases Satellite 6.0 installation should work properly (login, logout, syncing content).

Comment 5 Bryan Kearney 2014-05-09 15:04:06 UTC
Delivered in katello-installer-0.0.37-1.el6sat.noarch

Comment 6 Tazim Kolhar 2014-06-02 11:34:49 UTC
please provide verification steps

Comment 7 Tazim Kolhar 2014-06-02 12:04:26 UTC
change FQDN to something without domain

run the installer
 

# katello-installer
Output of 'facter fqdn' is different from 'hostname -f'
 
Make sure above command gives the same output. If needed, change the hostname permanently via 'hostname' command and editing 
appropriate configuration file.
(e.g. on Red Hat systems /etc/sysconfig/network).

If 'hostname -f' still returns unexpected result, check /etc/hosts and put
hostname entry in the correct order, for example:
 
  1.2.3.4 full.hostname.com full
 
Fully qualified hostname must be the first entry on the line
Your system does not meet configuration criteria

installer gives error

Comment 8 Bryan Kearney 2014-07-02 14:07:00 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.