summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/server/install.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-09-01 19:05:01 +0200
committerMartin Basti <mbasti@redhat.com>2015-09-03 16:01:30 +0200
commit0bcf0c1be9be99a0301051eef048fac9b178f735 (patch)
treeb94a1454a32a363a4858765fed7dfd831ec0e1be /ipaserver/install/server/install.py
parent0c5e41cc79f75e12094773cdf5a296dd06052763 (diff)
downloadfreeipa-0bcf0c1be9be99a0301051eef048fac9b178f735.tar.gz
freeipa-0bcf0c1be9be99a0301051eef048fac9b178f735.tar.xz
freeipa-0bcf0c1be9be99a0301051eef048fac9b178f735.zip
Installer: do not modify /etc/hosts before user agreement
https://fedorahosted.org/freeipa/ticket/4561 As side effect this also fixes: https://fedorahosted.org/freeipa/ticket/5266 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver/install/server/install.py')
-rw-r--r--ipaserver/install/server/install.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index dfaf67d0d..f9baa0757 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -34,7 +34,8 @@ from ipaserver.install import (
otpdinstance, replication, service, sysupgrade)
from ipaserver.install.installutils import (
IPA_MODULES, BadHostError, get_fqdn, get_server_ip_address,
- is_ipa_configured, load_pkcs12, read_password, verify_fqdn)
+ is_ipa_configured, load_pkcs12, read_password, verify_fqdn,
+ update_hosts_file)
from ipaserver.plugins.ldap2 import ldap2
try:
@@ -610,10 +611,15 @@ def install_check(installer):
dns.install_check(False, False, options, host_name)
ip_addresses = dns.ip_addresses
else:
- ip_addresses = get_server_ip_address(host_name, fstore,
+ ip_addresses = get_server_ip_address(host_name,
not installer.interactive, False,
options.ip_addresses)
+ # installer needs to update hosts file when DNS subsystem will be
+ # installed or custom addresses are used
+ if options.ip_addresses or options.setup_dns:
+ installer._update_hosts_file = True
+
print()
print("The IPA Master Server will be configured with:")
print("Hostname: %s" % host_name)
@@ -712,6 +718,9 @@ def install(installer):
# configure /etc/sysconfig/network to contain the custom hostname
tasks.backup_and_replace_hostname(fstore, sstore, host_name)
+ if installer._update_hosts_file:
+ update_hosts_file(ip_addresses, host_name, fstore)
+
# Create DS user/group if it doesn't exist yet
dsinstance.create_ds_user()
@@ -1497,6 +1506,7 @@ class Server(common.Installable, common.Interactive, core.Composite):
self._external_cert_file = None
self._external_ca_file = None
self._ca_cert = None
+ self._update_hosts_file = False
#pylint: disable=no-member