Skip to content

Commit

Permalink
Server affinity: call ca.install() if there is a CA in the topology
Browse files Browse the repository at this point in the history
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 <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
  • Loading branch information
rcritten authored and flo-renaud committed Jan 23, 2024
1 parent 5adc07a commit e6014a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions ipaserver/install/ca.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions ipaserver/install/server/replicainstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down

0 comments on commit e6014a5

Please sign in to comment.