Looping through all registered client nodes?

98 views
Skip to first unread message

H. Wade Minter

unread,
Feb 24, 2012, 10:20:31 AM2/24/12
to Puppet Users
I'm looking to see if there's a way that I can set up a class on my
puppetmaster node to loop through all of the defined nodes and add a
hosts entry for the internal IP. I think I'm good with the actual
adding of the entry, but I'm curious as to how to get access to all
defined hosts and loop through their facts.

Basically I want to manage /etc/hosts on the puppetmaster using
information about all of the registered nodes.

Any pointers?

Paul Tötterman

unread,
Feb 27, 2012, 3:55:09 AM2/27/12
to puppet...@googlegroups.com
Hi,
 
I'm looking to see if there's a way that I can set up a class on my
puppetmaster node to loop through all of the defined nodes and add a
hosts entry for the internal IP. I think I'm good with the actual
adding of the entry, but I'm curious as to how to get access to all
defined hosts and loop through their facts.

Not really defined nodes, but it should be possible to use exported resources to export the ip address of each node and then collect them. http://docs.puppetlabs.com/guides/exported_resources.html

Cheers,
Paul
Reply all
Reply to author
Forward
0 new messages