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")
Latest posts by Surendra Anne (see all)
- Docker: How to copy files to/from docker container - June 30, 2020
- Anisble: ERROR! unexpected parameter type in action:
Fix - June 29, 2020 - FREE: JOIN OUR DEVOPS TELEGRAM GROUPS - August 2, 2019
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018