Step 1: Clear and regenerate certs on your primary Puppet Server
On the primary server hosting the CA:
- Back up the SSL
directory, which is in
/etc/puppetlabs/puppet/ssl/. If something goes wrong, you can restore this directory so your deployment can stay functional. However, if you needed to regenerate your certs for security reasons and couldn’t, get some assistance as soon as possible so you can keep your site secure. -
Stop the agent service:
Copysudo puppet resource service puppet ensure=stopped -
Stop the primary server service.
For Puppet Server, run:
Copysudo puppet resource service puppetserver ensure=stopped -
Delete the SSL directory:
Copysudo rm -r /etc/puppetlabs/puppet/ssl -
Regenerate the CA and primary server's cert:
Copysudo puppetserver ca setupYou will see this message:
Notice: Signed certificate request for ca. -
Start the primary server service by running:
Copysudo puppet resource service puppetserver ensure=running -
Start the Puppet agent service by running this command:
Copysudo puppet resource service puppet ensure=running
Results
At this point:
You have a new CA certificate and key.
Your primary server has a certificate from the new CA, and it can field new certificate requests.
The primary server rejects any requests for configuration catalogs from nodes that haven’t replaced their certificates. At this point, it is all of them except itself.
When using any extensions that rely on Puppet certificates, like PuppetDB, the primary server won’t be able to communicate with them. Consequently, it might not be able to serve catalogs, even to agents that do have new certificates.