How to update puppet certificate on puppet client?

You can use below command to update puppet client certificate 
using below commands.

Go to your puppet master and clean client certificate:
# puppetserver ca clean <hostname>
Now login to client and run below commands:
# systemctl stop puppet
# rm -r /var/lib/puppet/ssl
# systemctl start puppet
On Server go and register if needed:
# puppetserver ca list
# puppet ca sign --certname <hostname>  # if needed
Below is an ansible playbook to register it again. You need to 
just clean and register on puppet master.
- name: Update certificate on puppet nodes
  hosts: test
  become: true
  remote_user: user1
  become_method: sudo

  tasks:

  - name: Stop Puppet service on client
	service:
  	name: puppet
  	state: stopped

  - name: Clean old certificate on server
    shell: rm -r /var/lib/puppet/ssl
    ignore_errors: yes

  - name: Start puppet agent service on client
    service:
 	  name: puppet
 	  state: started

Leave a Reply

Your email address will not be published. Required fields are marked *