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:

	[root@centos1 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:

	[root@centos1 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.

puppet cert list –all

	Output:
[root@centos1 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")

 

The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.