From e67d0b34bea880cd8859c44604f40e4b92f86b55 Mon Sep 17 00:00:00 2001 From: Ioannis Karasavvaidis Date: Tue, 17 Sep 2024 10:16:22 +0100 Subject: [PATCH] feat(convert_compiler_to_legacy): gather certificate extension information - Updated `puppetdb_host` to include both internal compiler pool addresses. - Modified `convert_compiler_to_legacy` plan to gather certificate extension information from legacy targets using the `peadm::cert_data` task. - Adjusted filtering of legacy compiler targets based on availability group using the gathered certificate data. This enhancement improves the accuracy of the conversion process by ensuring that the correct certificate data is used. --- manifests/setup/legacy_compiler_group.pp | 2 +- plans/convert_compiler_to_legacy.pp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/setup/legacy_compiler_group.pp b/manifests/setup/legacy_compiler_group.pp index 870297ad..e3601200 100644 --- a/manifests/setup/legacy_compiler_group.pp +++ b/manifests/setup/legacy_compiler_group.pp @@ -16,7 +16,7 @@ ], classes => { 'puppet_enterprise::profile::master' => { - 'puppetdb_host' => [$internal_compiler_a_pool_address, $internal_compiler_a_pool_address].filter |$_| { $_ }, + 'puppetdb_host' => [$internal_compiler_a_pool_address, $internal_compiler_b_pool_address].filter |$_| { $_ }, 'puppetdb_port' => [8081], }, }, diff --git a/plans/convert_compiler_to_legacy.pp b/plans/convert_compiler_to_legacy.pp index 0486ebc1..856cbe1c 100644 --- a/plans/convert_compiler_to_legacy.pp +++ b/plans/convert_compiler_to_legacy.pp @@ -22,7 +22,7 @@ $replica_target = peadm::get_targets($replica_host, 1) $primary_postgresql_target = peadm::get_targets($primary_postgresql_host, 1) $replica_postgresql_target = peadm::get_targets($replica_postgresql_host, 1) - $compiler_targets = peadm::get_targets($compiler_hosts) + $compiler_targets = peadm::get_targets($compiler_hosts) - $convert_legacy_compiler_targets $legacy_targets = peadm::get_targets($legacy_compilers) + $convert_legacy_compiler_targets $all_targets = peadm::flatten_compact([ @@ -46,7 +46,7 @@ if $arch['disaster-recovery'] { # Gather certificate extension information from all systems - $cert_extensions = run_task('peadm::cert_data', $all_targets).reduce({}) |$memo,$result| { + $cert_extensions = run_task('peadm::cert_data', $legacy_targets).reduce({}) |$memo,$result| { $memo + { $result.target.peadm::certname => $result['extensions'] } } $legacy_compiler_a_targets = $convert_legacy_compiler_targets.filter |$index,$target| {