Skip to content

Commit

Permalink
feat(convert_compiler_to_legacy): gather certificate extension inform…
Browse files Browse the repository at this point in the history
…ation

- 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.
  • Loading branch information
CoMfUcIoS committed Sep 17, 2024
1 parent 7533166 commit e67d0b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifests/setup/legacy_compiler_group.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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],
},
},
Expand Down
4 changes: 2 additions & 2 deletions plans/convert_compiler_to_legacy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -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| {
Expand Down

0 comments on commit e67d0b3

Please sign in to comment.