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
grep -io 'node .* ' /etc/puppet/manifests/site.pp
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
[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)
- 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
- wget download a file to a directory in Linux/Unix - June 4, 2018
- GIT: How to compare two GIT branches? - June 3, 2018
- Online training on Linux Bash shell scripting - February 8, 2018