Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 714919 - ipa-client-install should configure hostname
ipa-client-install should configure hostname
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa (Show other bugs)
6.1
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Rob Crittenden
Chandrasekar Kannan
:
Depends On:
Blocks: 748554
  Show dependency treegraph
 
Reported: 2011-06-21 06:36 EDT by Marko Myllynen
Modified: 2015-01-04 18:49 EST (History)
7 users (show)

See Also:
Fixed In Version: ipa-2.1.3-1.el6
Doc Type: Bug Fix
Doc Text:
Cause: ipa-client-install should configure hostname in /etc/sysconfig/network. Consequence: If the --hostname value is passed to the client installer that name is used during enrollment but the system host name may not match the name of the machine. Fix: Update /etc/sysconfig/network and execute /bin/hostname with the host name of the machine. Result: The name used in enrollment matches the host name of the machine.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 13:36:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1533 normal SHIPPED_LIVE Moderate: ipa security and bug fix update 2011-12-05 20:23:31 EST

  None (edit)
Description Marko Myllynen 2011-06-21 06:36:17 EDT
Description of problem:
When enrolling a client which has been previously installed and set up to use DHCP, the client's hostname can be more or less anything. Using ipa-client-install --hostname sets the hostname for the client at the server but leaves the client's /etc/sysconfig/network unmodified which might cause the client to use a DHCP provided hostname which will be in conflict with the hostname configured on the master side.

ipa-client-install should at least optionally configure /etc/sysconfig/network to use the hostname specified with --hostname.

Version-Release number of selected component (if applicable):
RHEL 6.1
Comment 2 Dmitri Pal 2011-06-21 17:10:44 EDT
https://fedorahosted.org/freeipa/ticket/1368
Comment 3 Martin Kosek 2011-07-29 10:27:33 EDT
Fixed upstream:
master: https://fedorahosted.org/freeipa/changeset/a22d00234f94f825d5ff2b6af6e94ce11f98c753
Comment 6 Marko Myllynen 2011-09-22 01:58:14 EDT
In https://bugzilla.redhat.com/show_bug.cgi?id=734013#c8 there is a test run where --hostname is not used and /etc/sysconfig/network is left with HOSTNAME=localhost.localdomain.

What happens if the client's IP changes, will its hostname be changed then, too? I think ipa-client-install should have updated /etc/sysconfig/network also without --hostname.

Thanks.
Comment 7 Rob Crittenden 2011-09-22 08:24:47 EDT
Where would this hostname come from? If by definition HOSTNAME is locahost.localdomain and the network is DHCP where would the hostname come from?
Comment 8 Marko Myllynen 2011-09-22 08:34:24 EDT
That is a good question - if you have IP provided based on the MAC address then you should always get also the same hostname and there shouldn't be any issues.

However, if one is enrolling a client with dynamic hostname it will sooner or later boot up with a different hostname than it was registered with and this might lead to unexpected behaviour.

Perhaps ipa-client-install should at least print out a warning in case of enrolling with dynamic hostname and --hostname not used?
Comment 9 Alexander Bokovoy 2011-09-22 09:34:27 EDT
How can we identify that the hostname is a dynamic one?

1. HOSTNAME=localhost.localdomain in /etc/sysconfig/network + real hostname != localhost.localdomain would give us this assumption (NM or dhclient set the hostname)
2. HOSTNAME absent from /etc/sysconfig/network would not mean anything.
3. HOSTNAME != localhost.localdomain and not equal actual host's hostname does not mean DHCP neccessarily.
Comment 10 Marko Myllynen 2011-09-22 09:46:05 EDT
I'd say if in doubt, print a note. Better safe than sorry.
Comment 11 Marko Myllynen 2011-09-26 05:43:20 EDT
https://fedorahosted.org/freeipa/ticket/1871
Comment 12 Jenny Galipeau 2011-10-05 16:39:11 EDT
Pre ipa-client-install

# hostname
nec-em24-3.rhts.eng.bos.redhat.com

# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=nec-em24-3.rhts.eng.bos.redhat.com

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


client install 

# ipa-client-install --hostname ipaclient.jgalipea.redhat.com
DNS domain 'jgalipea' is not configured for automatic KDC address lookup.
KDC address will be set to fixed value.

Discovery was successful!
Hostname: ipaclient.jgalipea.redhat.com
Realm: JGALIPEA
DNS Domain: jgalipea.redhat.com
IPA Server: ipaserver.jgalipea.redhat.com
BaseDN: dc=jgalipea


Continue to configure the system with these values? [no]: yes
Failed to set permissions for /etc/sysconfig/network (Command '/sbin/restorecon /etc/sysconfig/network' returned non-zero exit status 1).
User authorized to enroll computers: admin
Password for admin@JGALIPEA: 

Enrolled in IPA realm JGALIPEA
Created /etc/ipa/default.conf
Configured /etc/sssd/sssd.conf
Configured /etc/krb5.conf for IPA realm JGALIPEA
SSSD enabled
Kerberos 5 enabled
NTP enabled
Client configuration complete.


post ipa-client-install

# hostname
ipaserver.jgalipea.redhat.com

# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=ipaclient.jgalipea.redhat.com


# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


version ::
ipa-server-2.1.1-4.el6.x86_64
ipa-client-2.1.1-4.el6.x86_64
Comment 13 Rob Crittenden 2011-10-12 11:33:51 EDT
Marko discovered that if HOSTNAME does not exist in /etc/sysconfig/network then the previous code would fail to add it.

Fixed upstream in 

master: 8badce286f9e50384b68e0f5e77e314fd48363db

ipa-2-1: b17dfe4a8623e8c3e88c424ddaf7ad664c97898b
Comment 14 Marko Myllynen 2011-10-13 06:08:20 EDT
I think for the time being the case described in comment 18 should at least be documented:

https://fedorahosted.org/freeipa/ticket/1967
Comment 15 Marko Myllynen 2011-10-13 06:09:18 EDT
(In reply to comment #14)
> I think for the time being the case described in comment 18

Meant comment 8 of course.
Comment 16 Rob Crittenden 2011-10-31 16:23:51 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: ipa-client-install should configure hostname in /etc/sysconfig/network.
Consequence: If the --hostname value is passed to the client installer that name is used during enrollment but the system host name may not match the name of the machine.
Fix: Update /etc/sysconfig/network and execute /bin/hostname with the host name of the machine.
Result: The name used in enrollment matches the host name of the machine.
Comment 17 Namita Soman 2011-11-04 12:14:45 EDT
verified using ipa-client-2.1.3-8.el6.x86_64

ran:
/etc/sysconfig/network does not have HOSTNAME before install:
[root@ipa-replica2 ~]# cat /etc/sysconfig/network
NETWORKING=yes


Installed client:
[root@ipa-replica2 ~]# ipa-client-install --hostname=ipa-client1.testrelm -p admin -w Secret123 --server=ipa-master.testrelm --domain=testrelm
Discovery was successful!
Hostname: ipa-client1.testrelm
Realm: TESTRELM
DNS Domain: testrelm
IPA Server: ipa-master.testrelm
BaseDN: dc=testrelm


Continue to configure the system with these values? [no]: y
Synchronizing time with KDC...

Enrolled in IPA realm TESTRELM
Created /etc/ipa/default.conf
Configured /etc/sssd/sssd.conf
Configured /etc/krb5.conf for IPA realm TESTRELM
Warning: Hostname (ipa-client1.testrelm) not found in DNS
DNS server record set to: ipa-client1.testrelm -> 10.16.18.91
SSSD enabled
NTP enabled
Client configuration complete.

After install, checked:
[root@ipa-replica2 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=ipa-client1.testrelm

[root@ipa-replica2 ~]# hostname
ipa-client1.testrelm
Comment 18 errata-xmlrpc 2011-12-06 13:36:13 EST
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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHSA-2011-1533.html

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