Add record(s) to /etc/host when IPA is configured as DNS server.

This is to avoid chicken-egg problem when directory server fails to start
without resolvable hostname and named fails to provide hostname without
directory server.

https://fedorahosted.org/freeipa/ticket/4220

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
David Kupka 2014-09-02 16:32:30 +02:00 committed by Petr Viktorin
parent e26b3e14eb
commit 8aa01e24a1

View File

@ -489,7 +489,7 @@ def get_server_ip_address(host_name, fstore, unattended, options):
hosts_record = record_in_hosts(ip_address)
if hosts_record is None:
if ip_add_to_hosts:
if ip_add_to_hosts or options.setup_dns:
print "Adding ["+ip_address+" "+host_name+"] to your /etc/hosts file"
fstore.backup_file(paths.HOSTS)
add_record_to_hosts(ip_address, host_name)