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 Trevor Vaughan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This might just do it. I feel like I tried this and it didn't work but I'll give it another shot. Thanks! Trevor On 11/22/2011 03:10 AM, Dan Bode wrote: > You could use the resource_type indirection to query all of the resource > types and select t

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 Peter Meier
Hi 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 fro

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 resulti

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 Dan Bode
You could use the resource_type indirection to query all of the resource types and select the ones of type node. This will only query the nodes that were specified in manifests (which is quite different from all of the nodes that have checked in) Below is some example code: require "puppet/face"

[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-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-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 befor

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

[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: > 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