|
|
979ee0 |
From 37199834acaeee96136b096030198b2e9c8f16c8 Mon Sep 17 00:00:00 2001
|
|
|
979ee0 |
From: =?UTF-8?q?Tibor=20Dudl=C3=A1k?= <tdudlak@redhat.com>
|
|
|
979ee0 |
Date: Thu, 26 Jul 2018 11:46:55 +0200
|
|
|
979ee0 |
Subject: [PATCH] Do not set ca_host when --setup-ca is used
|
|
|
979ee0 |
|
|
|
979ee0 |
Setting ca_host caused replication failures on DL0
|
|
|
979ee0 |
because it was trying to connect to wrong CA host.
|
|
|
979ee0 |
Trying to avoid corner-case in ipaserver/plugins/dogtag.py
|
|
|
979ee0 |
when api.env.host nor api.env.ca_host had not CA configured
|
|
|
979ee0 |
and there was ca_host set to api.env.ca_host variable.
|
|
|
979ee0 |
|
|
|
979ee0 |
See: https://pagure.io/freeipa/issue/7566
|
|
|
979ee0 |
Resolves: https://pagure.io/freeipa/issue/7629
|
|
|
979ee0 |
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
|
|
|
979ee0 |
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
|
|
|
979ee0 |
Reviewed-By: Christian Heimes <cheimes@redhat.com>
|
|
|
979ee0 |
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
|
|
|
979ee0 |
---
|
|
|
979ee0 |
ipaserver/install/cainstance.py | 24 ++++++++++++++++++++++
|
|
|
979ee0 |
ipaserver/install/server/replicainstall.py | 7 +++++--
|
|
|
979ee0 |
2 files changed, 29 insertions(+), 2 deletions(-)
|
|
|
979ee0 |
|
|
|
979ee0 |
diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
|
|
|
979ee0 |
index e207911814e3553c5aa5310694170d3575337c55..cb8dc43096b8851d7554447f28c4537a35b47852 100644
|
|
|
979ee0 |
--- a/ipaserver/install/cainstance.py
|
|
|
979ee0 |
+++ b/ipaserver/install/cainstance.py
|
|
|
979ee0 |
@@ -435,6 +435,11 @@ class CAInstance(DogtagInstance):
|
|
|
979ee0 |
self.step("updating IPA configuration", update_ipa_conf)
|
|
|
979ee0 |
self.step("enabling CA instance", self.__enable_instance)
|
|
|
979ee0 |
if not promote:
|
|
|
979ee0 |
+ if self.clone:
|
|
|
979ee0 |
+ # DL0 workaround; see docstring of __expose_ca_in_ldap
|
|
|
979ee0 |
+ self.step("exposing CA instance on LDAP",
|
|
|
979ee0 |
+ self.__expose_ca_in_ldap)
|
|
|
979ee0 |
+
|
|
|
979ee0 |
self.step("migrating certificate profiles to LDAP",
|
|
|
979ee0 |
migrate_profiles_to_ldap)
|
|
|
979ee0 |
self.step("importing IPA certificate profiles",
|
|
|
979ee0 |
@@ -1222,6 +1227,25 @@ class CAInstance(DogtagInstance):
|
|
|
979ee0 |
config = []
|
|
|
979ee0 |
self.ldap_configure('CA', self.fqdn, None, basedn, config)
|
|
|
979ee0 |
|
|
|
979ee0 |
+ def __expose_ca_in_ldap(self):
|
|
|
979ee0 |
+ """
|
|
|
979ee0 |
+ In a case when replica is created on DL0 we need to make
|
|
|
979ee0 |
+ sure that query for CA service record of this replica in
|
|
|
979ee0 |
+ ldap will succeed in time of installation.
|
|
|
979ee0 |
+ This method is needed for sucessfull replica installation
|
|
|
979ee0 |
+ on DL0 and should be removed alongside with code for DL0.
|
|
|
979ee0 |
+
|
|
|
979ee0 |
+ To suppress deprecation warning message this method is
|
|
|
979ee0 |
+ not invoking ldap_enable() but _ldap_enable() method.
|
|
|
979ee0 |
+ """
|
|
|
979ee0 |
+
|
|
|
979ee0 |
+ basedn = ipautil.realm_to_suffix(self.realm)
|
|
|
979ee0 |
+ if not self.clone:
|
|
|
979ee0 |
+ config = ['caRenewalMaster']
|
|
|
979ee0 |
+ else:
|
|
|
979ee0 |
+ config = []
|
|
|
979ee0 |
+ self._ldap_enable(u'enabledService', "CA", self.fqdn, basedn, config)
|
|
|
979ee0 |
+
|
|
|
979ee0 |
def setup_lightweight_ca_key_retrieval(self):
|
|
|
979ee0 |
if sysupgrade.get_upgrade_state('dogtag', 'setup_lwca_key_retrieval'):
|
|
|
979ee0 |
return
|
|
|
979ee0 |
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
|
|
|
979ee0 |
index d8c55370d33d59efdf838f7ba01efedae7857406..8a659a0fc2675df0a8fba1d3d7d8a629b376c93e 100644
|
|
|
979ee0 |
--- a/ipaserver/install/server/replicainstall.py
|
|
|
979ee0 |
+++ b/ipaserver/install/server/replicainstall.py
|
|
|
979ee0 |
@@ -236,9 +236,12 @@ def create_ipa_conf(fstore, config, ca_enabled, master=None):
|
|
|
979ee0 |
gopts.extend([
|
|
|
979ee0 |
ipaconf.setOption('enable_ra', 'True'),
|
|
|
979ee0 |
ipaconf.setOption('ra_plugin', 'dogtag'),
|
|
|
979ee0 |
- ipaconf.setOption('dogtag_version', '10'),
|
|
|
979ee0 |
- ipaconf.setOption('ca_host', config.ca_host_name)
|
|
|
979ee0 |
+ ipaconf.setOption('dogtag_version', '10')
|
|
|
979ee0 |
])
|
|
|
979ee0 |
+
|
|
|
979ee0 |
+ if not config.setup_ca:
|
|
|
979ee0 |
+ gopts.append(ipaconf.setOption('ca_host', config.ca_host_name))
|
|
|
979ee0 |
+
|
|
|
979ee0 |
else:
|
|
|
979ee0 |
gopts.extend([
|
|
|
979ee0 |
ipaconf.setOption('enable_ra', 'False'),
|
|
|
979ee0 |
--
|
|
|
979ee0 |
2.17.1
|
|
|
979ee0 |
|