From a83523e37ee70a10e49b40f8880c2d0fb3088562 Mon Sep 17 00:00:00 2001 From: Petr Spacek Date: Aug 10 2016 08:48:05 +0000 Subject: server-install: Fix --hostname option to always override api.env values Attempts to compare local hostname with user-provided values are error prone as we found out in #5794. This patch removes comparison and makes the env values deterministic. https://fedorahosted.org/freeipa/ticket/6071 Reviewed-By: Jan Cholasta --- diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py index 65f9318..1e92559 100644 --- a/ipaserver/install/server/install.py +++ b/ipaserver/install/server/install.py @@ -560,7 +560,12 @@ def install_check(installer): cfg = dict( context='installer', in_server=True, + # make sure host name specified by user is used instead of default + host=host_name, ) + if setup_ca: + # we have an IPA-integrated CA + cfg['ca_host'] = host_name # Create the management framework config file and finalize api target_fname = paths.IPA_DEFAULT_CONF @@ -586,14 +591,6 @@ def install_check(installer): # Must be readable for everyone os.chmod(target_fname, 0o644) - system_hostname = get_fqdn() - if host_name != system_hostname: - root_logger.debug("Chosen hostname (%s) differs from system hostname " - "(%s) - change it" % (host_name, system_hostname)) - # update `api.env.ca_host` to correct hostname - # https://fedorahosted.org/freeipa/ticket/4936 - api.env.ca_host = host_name - api.bootstrap(**cfg) api.finalize()