This is (almost) trivial. First, create a fact that turns /var/lib/puppet/state/classes.txt into an array. Then extract that fact from the storedconfigs DB programmatically. Admittedly, this won't get all defined nodes, as that is somewhat meaningless since nodes can be "default" or regular exceptions. Instead, this gets all nodes that have run Puppet at least once.
On Nov 20, 2011, at 6:04 PM, James Turnbull wrote: > Trevor Vaughan wrote: >> Sorry but...bump? >> >> On 11/18/2011 02:20 PM, Trevor Vaughan wrote: >>> Sorry if this is a double post, my e-mail glitched on me. >> >>> Anyway, I'm trying to write a Ruby script that can get all defined >>> nodes and all classes assigned to those nodes. I would prefer to not >>> have to compile a catalog for each node. >> >>> I tried looking through the puppet/util/rdoc material but it really >>> didn't handle the node entries as far as I could tell and also didn't >>> seem to have a way to get the info without printing it all out. >> > > Sorry missed this one - I do something vaguely similar for the Puppet > Rundeck integration - have a look at the code at: > > https://github.com/jamtur01/puppet-rundeck > > Others may be able to chime in with better ideas. > > James > > -- > James Turnbull > Puppet Labs > 1-503-734-8571 > To schedule a meeting with me: http://tungle.me/jamtur01 > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.