Skip to content

Commit 55d852f

Browse files
author
petergmurphy
committed
Migrate to new method for legacy compiler checks
1 parent 81e986a commit 55d852f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

plans/upgrade.pp

+20
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,26 @@
135135

136136
peadm::assert_supported_pe_version($_version, $permit_unsafe_versions)
137137

138+
# Gather certificate extension information from all systems
139+
$cert_extensions_temp = run_task('peadm::cert_data', $all_targets).reduce({}) |$memo,$result| {
140+
$memo + { $result.target.peadm::certname => $result['extensions'] }
141+
}
142+
143+
# Add legacy compiler role to compilers that are missing it
144+
$legacy_compiler_targets = $cert_extensions_temp.filter |$name,$exts| {
145+
($name in $compiler_targets.map |$t| { $t.name }) and
146+
($exts[peadm::oid('peadm_legacy_compiler')] != undef) and
147+
($exts[peadm::oid('peadm_legacy_compiler')] == 'true') and
148+
($exts['pp_auth_role'] != 'pe_compiler_legacy')
149+
}.keys
150+
151+
run_plan('peadm::modify_certificate', $legacy_compiler_targets,
152+
primary_host => $primary_target,
153+
add_extensions => {
154+
'pp_auth_role' => 'pe_compiler_legacy',
155+
},
156+
)
157+
138158
# Gather certificate extension information from all systems
139159
$cert_extensions = run_task('peadm::cert_data', $all_targets).reduce({}) |$memo,$result| {
140160
$memo + { $result.target.peadm::certname => $result['extensions'] }

0 commit comments

Comments
 (0)