From e6014a5c1996528b255480b67fe2937203bff81b Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Jan 23 2024 15:32:58 +0000 Subject: Server affinity: call ca.install() if there is a CA in the topology This should not have been gated on options.setup_ca because we need the RA agent on all servers if there is a CA in the topology otherwise the non-CA servers won't be able to communicate with the CA. Fixes: https://pagure.io/freeipa/issue/9510 Signed-off-by: Rob Crittenden Reviewed-By: Florence Blanc-Renaud --- diff --git a/ipaserver/install/ca.py b/ipaserver/install/ca.py index c93ae1f..187f803 100644 --- a/ipaserver/install/ca.py +++ b/ipaserver/install/ca.py @@ -387,9 +387,10 @@ def install_step_0(standalone, replica_config, options, custodia): promote = False else: cafile = os.path.join(replica_config.dir, 'cacert.p12') - custodia.get_ca_keys( - cafile, - replica_config.dirman_password) + if replica_config.setup_ca: + custodia.get_ca_keys( + cafile, + replica_config.dirman_password) ca_signing_algorithm = None ca_type = None diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py index f8d4733..4c1c07c 100644 --- a/ipaserver/install/server/replicainstall.py +++ b/ipaserver/install/server/replicainstall.py @@ -1359,11 +1359,13 @@ def install(installer): custodia = custodiainstance.get_custodia_instance(config, mode) custodia.create_instance() - if options.setup_ca and ca_enabled: + if ca_enabled: options.realm_name = config.realm_name options.domain_name = config.domain_name options.host_name = config.host_name options.dm_password = config.dirman_password + # Always call ca.install() if there is a CA in the topology + # to ensure the RA agent is present. ca.install(False, config, options, custodia=custodia) # configure PKINIT now that all required services are in place @@ -1375,7 +1377,8 @@ def install(installer): service.print_msg("Finalize replication settings") ds.finalize_replica_config() - if options.setup_kra and kra_enabled: + if kra_enabled: + # The KRA installer checks for itself the status of setup_kra kra.install(api, config, options, custodia=custodia) service.print_msg("Restarting the KDC")