Slackbot
01/26/2023, 10:37 PMJustin
01/26/2023, 10:51 PMsupport_tasks::st0317b_purge_node is, but if the new node using a different certificate and you don't allow duplicate, you will need to clean the certificate on server and node and regenerate, or just copy the old one from the old one if you have them.Jerry Way
01/26/2023, 11:04 PMJustin
01/26/2023, 11:16 PMpuppetserver_ca_clean
class PuppetserverCAClean < EnterpriseTaskHelper
def task(host: nil, **_kwargs)
...
test_cert_cmd = ['test', '-e', "#{ca_dir}/signed/#{host}.pem"]
_output, cert_status = Open3.capture2e(*test_cert_cmd)
test_csr_cmd = ['test', '-e', "#{ca_dir}/requests/#{host}.pem"]
output, csr_status = Open3.capture2e(*test_csr_cmd)
cmd = ['/opt/puppetlabs/bin/puppetserver', 'ca', 'clean', "--certname=#{host}"]
output, status = Open3.capture2e(*cmd) if cert_status.exitstatus.zero? || csr_status.exitstatus.zero?Jerry Way
01/26/2023, 11:18 PMDavid Sandilands
01/26/2023, 11:22 PMDavid Sandilands
01/26/2023, 11:23 PMJerry Way
01/26/2023, 11:24 PMJustin
01/26/2023, 11:24 PMDavid Sandilands
01/26/2023, 11:25 PMDavid Sandilands
01/26/2023, 11:25 PMJerry Way
01/26/2023, 11:26 PMDavid Sandilands
01/26/2023, 11:27 PMJustin
01/26/2023, 11:28 PMDavid Sandilands
01/26/2023, 11:28 PMJerry Way
01/26/2023, 11:29 PMDavid Sandilands
01/26/2023, 11:31 PM