|
135 | 135 |
|
136 | 136 | peadm::assert_supported_pe_version($_version, $permit_unsafe_versions)
|
137 | 137 |
|
| 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 | + $compiler_missing_legacy_targets = $cert_extensions_temp.filter |$name,$exts| { |
| 144 | + ($name in $compiler_targets.map |$t| { $t.name }) and (peadm::oid('peadm_legacy_compiler') in $exts and $exts[peadm::oid('peadm_legacy_compiler')] == undef) |
| 145 | + }.keys |
| 146 | + |
| 147 | + run_plan('peadm::modify_certificate', $compiler_missing_legacy_targets, |
| 148 | + primary_host => $primary_target, |
| 149 | + add_extensions => { |
| 150 | + peadm::oid('peadm_legacy_compiler') => 'false', |
| 151 | + }, |
| 152 | + ) |
| 153 | + |
138 | 154 | # Gather certificate extension information from all systems
|
139 | 155 | $cert_extensions = run_task('peadm::cert_data', $all_targets).reduce({}) |$memo,$result| {
|
140 | 156 | $memo + { $result.target.peadm::certname => $result['extensions'] }
|
141 | 157 | }
|
142 | 158 |
|
143 | 159 | $convert_targets = $cert_extensions.filter |$name,$exts| {
|
144 |
| - ($name in $compiler_targets.map |$t| { $t.name }) and ($exts['pp_auth_role'] == undef) |
| 160 | + ($name in $compiler_targets.map |$t| { $t.name }) and ('pp_auth_role' in $exts and $exts['pp_auth_role'] == undef) |
145 | 161 | }.keys
|
146 | 162 |
|
147 | 163 | # Determine PE version currently installed on primary
|
|
151 | 167 |
|
152 | 168 | # Ensure needed trusted facts are available
|
153 | 169 | if $cert_extensions.any |$_,$cert| {
|
154 |
| - [peadm::oid('peadm_role'), 'pp_auth_role'].all |$ext| { $cert[$ext] == undef } or |
155 |
| - $cert[peadm::oid('peadm_availability_group')] == undef |
| 170 | + [peadm::oid('peadm_role'), 'pp_auth_role'].all |$ext| { $ext in $cert and $cert[$ext] == undef } or |
| 171 | + (peadm::oid('peadm_availability_group') in $cert and $cert[peadm::oid('peadm_availability_group')] == undef) |
156 | 172 | } {
|
157 | 173 | # lint:ignore:strict_indent
|
158 | 174 | fail_plan(@(HEREDOC/L))
|
|
0 commit comments