diff options
author | Martin Kosek <mkosek@redhat.com> | 2011-11-07 18:35:23 +0100 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-11-10 20:56:29 -0500 |
commit | 0165a03694db76462b62ca06cdc2b3f88312a154 (patch) | |
tree | 0f7c784729c017fbfab89a71e2cd4c6841ff79fc /install/tools/ipa-server-install | |
parent | 62c110a3b89e3f37d1f1fa24a2a533a708d5de26 (diff) | |
download | freeipa-0165a03694db76462b62ca06cdc2b3f88312a154.tar.gz freeipa-0165a03694db76462b62ca06cdc2b3f88312a154.tar.xz freeipa-0165a03694db76462b62ca06cdc2b3f88312a154.zip |
Hosts file not updated when IP is passed as option
When an IPA server with unresolvable hostname is being installed,
a hostname record must be inserted to /etc/hosts or the
installation will fail. However, it is not inserted when IP
address is passed as an option (--ip-address) and not
interactively. This patch fixes this so that /etc/hosts
record is inserted in both cases.
https://fedorahosted.org/freeipa/ticket/2074
Diffstat (limited to 'install/tools/ipa-server-install')
-rwxr-xr-x | install/tools/ipa-server-install | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install index 1dbeef596..4c56b6617 100755 --- a/install/tools/ipa-server-install +++ b/install/tools/ipa-server-install @@ -754,10 +754,14 @@ def main(): # Check we have a public IP that is associated with the hostname hostaddr = resolve_host(host_name) + ip_add_to_hosts = False if hostaddr is not None: ip = CheckedIPAddress(hostaddr, match_local=True) else: + # hostname is not resolvable ip = options.ip_address + ip_add_to_hosts = True + if ip is None: print "Unable to resolve IP address for host name" if options.unattended: @@ -772,11 +776,9 @@ def main(): ip = options.ip_address - ip_add_to_hosts = False if ip is None: ip = read_ip_address(host_name, fstore) logging.debug("read ip_address: %s\n" % str(ip)) - ip_add_to_hosts = True ip_address = str(ip) |