Hide Forgot
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
https://fedorahosted.org/freeipa/ticket/1368
Fixed upstream: master: https://fedorahosted.org/freeipa/changeset/a22d00234f94f825d5ff2b6af6e94ce11f98c753
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.
Where would this hostname come from? If by definition HOSTNAME is locahost.localdomain and the network is DHCP where would the hostname come from?
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?
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.
I'd say if in doubt, print a note. Better safe than sorry.
https://fedorahosted.org/freeipa/ticket/1871
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
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
I think for the time being the case described in comment 18 should at least be documented: https://fedorahosted.org/freeipa/ticket/1967
(In reply to comment #14) > I think for the time being the case described in comment 18 Meant comment 8 of course.
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.
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
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