Re: [Puppet-dev] Re: [Puppet Users] Re: Is it possible to get a list of all nodes in your manifests and all classes assigned to those nodes programatically in Ruby?

2011-11-22 Thread david-dasz
Hi Trevor, In the case of a default node, regexp nodes or an external node classifier, there *is* no well-defined list of potential nodes any more. Having said that, a solution might be to use the puppet compiler's internals to parse the site.pp and friends manually and access the AST resulting

Re: [Puppet Users] Re: Is it possible to get a list of all nodes in your manifests and all classes assigned to those nodes programatically in Ruby?

2011-11-21 Thread Brian Gallew
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

Re: [Puppet Users] Re: Is it possible to get a list of all nodes in your manifests and all classes assigned to those nodes programatically in Ruby?

2011-11-21 Thread Trevor Vaughan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks for the suggestions guys but I'm giving this one up as too annoying to bother. The issue was to detect the nodes that hadn't checked in but were defined in the manifest. Getting the information out of the YAML is pretty easy, yes. Thanks!

Re: [Puppet Users] Re: Is it possible to get a list of all nodes in your manifests and all classes assigned to those nodes programatically in Ruby?

2011-11-21 Thread Gonzalo Servat
I rely on Puppet dashboard to tell me which nodes haven't checked in for a while... :) - Gonzalo On Tue, Nov 22, 2011 at 11:43 AM, Trevor Vaughan tvaug...@onyxpoint.comwrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks for the suggestions guys but I'm giving this one up as too

[Puppet Users] Re: Is it possible to get a list of all nodes in your manifests and all classes assigned to those nodes programatically in Ruby?

2011-11-20 Thread Trevor Vaughan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 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

Re: [Puppet Users] Re: Is it possible to get a list of all nodes in your manifests and all classes assigned to those nodes programatically in Ruby?

2011-11-20 Thread James Turnbull
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

Re: [Puppet-dev] Re: [Puppet Users] Re: Is it possible to get a list of all nodes in your manifests and all classes assigned to those nodes programatically in Ruby?

2011-11-20 Thread Trevor Vaughan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks James. I knew how to do that, I was actually trying to figure out if I could do it the hard way by delving the manifests instead of having to wait for a system to check in. I'm pretty close to saying that the answer is 'no'. Thanks, Trevor

Re: [Puppet-dev] Re: [Puppet Users] Re: Is it possible to get a list of all nodes in your manifests and all classes assigned to those nodes programatically in Ruby?

2011-11-20 Thread James Turnbull
Trevor Vaughan wrote: Thanks James. I knew how to do that, I was actually trying to figure out if I could do it the hard way by delving the manifests instead of having to wait for a system to check in. I'm pretty close to saying that the answer is 'no'. Oh I see. You mean before the