mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
topology: manage ca replication agreements
Configure IPA so that topology plugin will manage also CA replication agreements. upgrades if CA is congigured: - ipaca suffix is added to cn=topology,cn=ipa,cn=etc,$SUFFIX - ipaReplTopoManagedSuffix: o=ipaca is added to master entry - binddngroup is added to o=ipaca replica entry Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
86240938b5
commit
fff31ca220
@ -141,8 +141,8 @@ Requires(post): systemd-units
|
||||
Requires: selinux-policy >= %{selinux_policy_version}
|
||||
Requires(post): selinux-policy-base >= %{selinux_policy_version}
|
||||
Requires: slapi-nis >= 0.54.2-1
|
||||
Requires: pki-ca >= 10.2.6
|
||||
Requires: pki-kra >= 10.2.6
|
||||
Requires: pki-ca >= 10.2.7
|
||||
Requires: pki-kra >= 10.2.7
|
||||
Requires(preun): python systemd-units
|
||||
Requires(postun): python systemd-units
|
||||
Requires: python-dns >= 1.11.1
|
||||
|
@ -27,6 +27,7 @@ app_DATA = \
|
||||
72domainlevels.ldif \
|
||||
anonymous-vlv.ldif \
|
||||
bootstrap-template.ldif \
|
||||
ca-topology.uldif \
|
||||
caJarSigningCert.cfg.template \
|
||||
custodia.conf.template \
|
||||
default-aci.ldif \
|
||||
|
15
install/share/ca-topology.uldif
Normal file
15
install/share/ca-topology.uldif
Normal file
@ -0,0 +1,15 @@
|
||||
# add IPA CA managed suffix to master entry
|
||||
dn: cn=$FQDN,cn=masters,cn=ipa,cn=etc,$SUFFIX
|
||||
add: objectclass: ipaReplTopoManagedServer
|
||||
add: ipaReplTopoManagedSuffix: o=ipaca
|
||||
|
||||
# add IPA CA topology configuration area
|
||||
dn: cn=ipaca,cn=topology,cn=ipa,cn=etc,$SUFFIX
|
||||
default: objectclass: top
|
||||
default: objectclass: iparepltopoconf
|
||||
default: ipaReplTopoConfRoot: o=ipaca
|
||||
default: cn: ipaca
|
||||
|
||||
# Update CA replication settings
|
||||
dn: cn=replica,cn=o\3Dipaca,cn=mapping tree,cn=config
|
||||
onlyifexist: nsds5replicabinddngroup: cn=replication managers,cn=sysaccounts,cn=etc,$SUFFIX
|
@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
# middle
|
||||
plugin: update_ca_topology
|
||||
plugin: update_dnszones
|
||||
plugin: update_dns_limits
|
||||
plugin: update_default_range
|
||||
|
@ -237,6 +237,7 @@ class BasePathNamespace(object):
|
||||
SMBD = "/usr/sbin/smbd"
|
||||
USERADD = "/usr/sbin/useradd"
|
||||
USR_SHARE_IPA_DIR = "/usr/share/ipa/"
|
||||
CA_TOPOLOGY_ULDIF = "/usr/share/ipa/ca-topology.uldif"
|
||||
FFEXTENSION = "/usr/share/ipa/ffextension"
|
||||
IPA_HTML_DIR = "/usr/share/ipa/html"
|
||||
CA_CRT = "/usr/share/ipa/html/ca.crt"
|
||||
|
@ -63,6 +63,7 @@ from ipapython.ipa_log_manager import log_mgr,\
|
||||
from ipaserver.install import certs
|
||||
from ipaserver.install import dsinstance
|
||||
from ipaserver.install import installutils
|
||||
from ipaserver.install import ldapupdate
|
||||
from ipaserver.install import service
|
||||
from ipaserver.install.dogtaginstance import (
|
||||
DEFAULT_DSPORT, PKI_USER, export_kra_agent_pem, DogtagInstance)
|
||||
@ -806,6 +807,15 @@ class CAInstance(DogtagInstance):
|
||||
except Exception as e:
|
||||
root_logger.warning("Failed to backup CS.cfg: %s", e)
|
||||
|
||||
def __update_topology(self):
|
||||
ld = ldapupdate.LDAPUpdate(ldapi=True, sub_dict={
|
||||
'SUFFIX': api.env.basedn,
|
||||
'FQDN': self.fqdn,
|
||||
})
|
||||
rv = ld.update([paths.CA_TOPOLOGY_ULDIF])
|
||||
if not rv:
|
||||
raise RuntimeError("Failed to update CA topology configuration")
|
||||
|
||||
def __disable_nonce(self):
|
||||
# Turn off Nonces
|
||||
update_result = installutils.update_file(
|
||||
|
34
ipaserver/install/plugins/update_ca_topology.py
Normal file
34
ipaserver/install/plugins/update_ca_topology.py
Normal file
@ -0,0 +1,34 @@
|
||||
#
|
||||
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
|
||||
from ipalib import api
|
||||
from ipalib import Updater
|
||||
from ipaserver.install import certs, cainstance
|
||||
from ipaserver.install import ldapupdate
|
||||
from ipaplatform.paths import paths
|
||||
|
||||
|
||||
class update_ca_topology(Updater):
|
||||
"""
|
||||
Updates CA topology configuration entries
|
||||
"""
|
||||
|
||||
def execute(self, **options):
|
||||
|
||||
ca = cainstance.CAInstance(self.api.env.realm, certs.NSS_DIR)
|
||||
if not ca.is_configured():
|
||||
self.log.debug("CA is not configured on this host")
|
||||
return False, []
|
||||
|
||||
ld = ldapupdate.LDAPUpdate(ldapi=True, sub_dict={
|
||||
'SUFFIX': self.api.env.basedn,
|
||||
'FQDN': self.api.env.host,
|
||||
})
|
||||
rv = ld.update([paths.CA_TOPOLOGY_ULDIF])
|
||||
if not rv:
|
||||
self.log.error("Failed to update CA topology configuration")
|
||||
|
||||
return False, []
|
||||
|
||||
api.register(update_ca_topology)
|
Loading…
Reference in New Issue
Block a user