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.
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