File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 2121 $certdata = run_task(' peadm::cert_data' , $target ).first.value
2222 $certname = $certdata [' certname' ]
2323
24-
25-
2624 $target_is_primary = ($certname == $primary_certname )
2725
2826 # These vars represent what the extensions currently are, vs. what they should be
6866 # fail the plan unless it's a known circumstance in which it's okay to proceed.
6967 # Scenario 1: the primary's cert can't be cleaned because it's already revoked.
7068 # Scenario 2: the primary's cert can't be cleaned because it's been deleted.
71- # Scenario 3: a component's cert can't be cleaned because it was previously by some other function .
69+ # Scenario 3: any component's cert can't be cleaned because it's been deleted .
7270 unless ($target_is_primary and
7371 ($ca_clean_result [merged_output] =~ /certificate revoked/ or
74- $ca_clean_result [merged_output] =~ /Could not find ' hostcert' / or
75- $ca_clean_result [merged_output] =~ /Could not find files to clean/) )
72+ $ca_clean_result [merged_output] =~ /Could not find ' hostcert' /)) or
73+ ( $ca_clean_result [merged_output] =~ /Could not find files to clean/)
7674 {
77- fail_plan($ca_clean_result )
75+ fail_plan($ca_clean_result [merged_output] )
7876 }
7977 }
8078
Original file line number Diff line number Diff line change 4040 $certstatus = run_task(' peadm::cert_valid_status' , $primary_target ,
4141 certname => $agent_target .peadm::certname()).first.value
4242
43+ # Obtain data about certificate from agent
44+ $certdata = run_task(' peadm::cert_data' , $agent_target ).first.value
45+
4346 if ($certstatus [' certificate-status' ] == ' invalid' ) {
4447 $force_regenerate = true
4548 $skip_csr = true
4649 } else {
50+ if $certdata [' certificate-exists' ] and $certstatus [' reason' ] =~ /The private key is missing from/ {
51+ out::message("Agent: ${agent_target.peadm::certname()} has a local cert but Primary: ${primary_target.peadm::certname()} does not, force agent clean" )
52+ run_task('peadm::ssl_clean', $agent_target , certname => $agent_target .peadm::certname())
53+ }
4754 $force_regenerate = false
4855 $skip_csr = false
49-
5056 }
5157
5258 # Ensures scenarios where agent was pre-installed but never on-boarding and
You can’t perform that action at this time.
0 commit comments