Q)Recently I installed couple of nodes and attached to Puppet master, How can I list all the nodes which are register with Puppet server? 

Answer) There are couple of ways to list all the nodes register with master. 

1)Through grepping node entries in /etc/puppet/manifests/site.pp(Though not a good way) 
2)Through puppet cert command

Listing entries though site.pp 

	grep -oi 'node .*  ' /etc/puppet/manifests/site.pp 

Output:

	grep -io 'node .* ' /etc/puppet/manifests/site.pp 
node 'ubuntu1.example.com' 
node 'centos1.example.com' 

From the above output we can come to a conclusion that our master have two nodes attached. As said earlier this is not that much reliable way to get node details. There are some situations where hosts are just register but did not require any configuration. 

List puppet nodes with puppet cert 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") 
+ "surendra" (B3:A6:A3:F2:2F:AA:7F:7A:25:37:8B:27:7A:E1:8C:77)

From the above ouput centos1.example.com and surendra are two machines which are attached to puppet master.

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.