Q) How can I remove a register a puppet agent from puppet master?

Some times it is required to remove a host(puppet node) from the register master. To achive this we have to run puppet cert command and have to manually remove entries from site.pp or other *.pp files where that host is register. This post show you how to remove host with puppet cert command so that it can not communicate with server on the master.

Removing puppet node from the master

First list all the nodes which are register with master server

	puppet cert list -a

Output:

	[[email protected] manifests]# puppet cert list -a
+ "centos1.example.com" (B4:52:73:D6:22:9B:55:35:E7:E3:DE:51:48:67:30:A0) (alt names: "DNS:centos1.example.com", "DNS:puppet", "DNS:puppet.example.com")
+ "surendra"            (B3:A6:A3:F2:2F:AA:7F:7A:25:37:8B:27:7A:E1:8C:77)

Once the host name is selected run puppet cert clean command as shown below.

	puppet cert clean <hostname>

Output:

	[[email protected] manifests]# puppet cert clean surendra
notice: Revoked certificate with serial 3
notice: Removing file Puppet::SSL::Certificate surendra at '/var/lib/puppet/ssl/ca/signed/surendra.pem'
notice: Removing file Puppet::SSL::Certificate surendra at '/var/lib/puppet/ssl/certs/surendra.pem'

Now check if the desired host is removed or not with list command.

Related concept:   Get BIOS, Firmware, Hardware And Drivers Details in Linux/Unix

puppet cert list –all

	Output:
[[email protected] manifests]# puppet cert list --all
+ "centos1.example.com" (B4:52:73:D6:22:9B:55:35:E7:E3:DE:51:48:67:30:A0) (alt names: "DNS:centos1.example.com", "DNS:puppet", "DNS:puppet.example.com")