Sorry, I should've clarified.  I was hoping to use the management classes 
for something other than puppet classes(more abstract things like nagios 
hostgroups, some of which share names with classes).  If I can't reliably 
populate the facts with class information though, I might not have a choice.

On Saturday, July 14, 2012 11:36:50 AM UTC-4, R.I. Pienaar wrote:
>
>
>
> ----- Original Message ----- 
> > From: "Nick Cammorato" <nick_cammor...@terc.edu> 
> > To: puppet-users@googlegroups.com 
> > Sent: Saturday, July 14, 2012 3:04:48 PM 
> > Subject: Re: [Puppet Users] Using catalog 
> inventory/Puppet::Resource::Catalog? 
> > 
> > I'm going to try this again and hope I forgot to hit submit rather 
> > than having a message to the list pending for approval. 
> > 
> > I want a list of classes contained in the puppet catalog that's been 
> > applied to the node, not management classes. At least in mco 2.0.0 
> > with minimal configuration, an mco inventory some.host or mco rpc 
> > rpcutil inventory -I some.host lists facts and mgmt classes. Now, 
> > I'm fairly new to mcollective, so I might be missing something 
> > obvious, in which case I'd greatly appreciate being told what :) 
> > 
> > What I started with was as an erb template for facts.yaml: 
> > <% 
> > # Gather all of our scope variables 
> > gather_vars = scope.to_hash.reject{ |k,v| k.to_s =~ 
> > /(uptime|free|timestamp|id|name|title|rsa|dsa)/ } 
> > # And then all of classes 
> > gather_vars.store('classcatalog', classes.sort.uniq.join(', ')) -%> 
> > <%= gather_vars.to_yaml %> 
> > 
> > And boom I can do an mco find --with-fact classcatalog=/corosync/ and 
> > it'll list all my nodes which use my corosync modules. 
> > 
> > Which appears to work, but I'm a bit leary of this since so much in 
> > puppet depends on order of execution and I've seen some odd scoping 
> > issues with staging. So while I have this being populated last, and 
> > use an ENC 90% of the time(which populates the management classes), 
> > and it all works, it might break in the future. I was hoping there 
> > was another way of exposing this. 
>
> I am not following, you do not need to gather this information for 
> mcollective to be aware of classes. 
>
> Puppet creates a file on every node that has a list of all the classes 
> on said node, on my machines this is in /var/lib/puppet/classes.txt 
>
> So I configure mcollective with: 
>
>    classesfile = /var/lib/puppet/classes.txt 
>
> and now I can just do mco find -C /someclass/ and it does what you want 
> no need to try and turn those into a fact or anything like that. 
>
> And if I do 'mco inventory some.node' I get a section displayed like: 
>
>    Configuration Management Classes: 
>       apache                         apache::config                 
>       apache::install                apache::logrotate             
>
>
> Does this method not work for you? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/aTomd-7TN9sJ.
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.

Reply via email to