It's pretty ghetto, but we've used this script before, which I can confirm
still works on Puppet 2.7.17:
http://www.devco.net/archives/2010/02/26/what_does_puppet_manage_on_a_node-2.php

cheers,

Walter

On Fri, Jul 13, 2012 at 4:22 AM, R.I.Pienaar <r...@devco.net> wrote:

>
>
> ----- Original Message -----
> > From: "Ryan Coleman" <r...@puppetlabs.com>
> > To: puppet-users@googlegroups.com
> > Sent: Thursday, July 12, 2012 9:08:55 PM
> > Subject: Re: [Puppet Users] How can I list classes available on the
> puppet master?
> >
> > Crap, I forgot to mention my source:
> >
> http://docs.puppetlabs.com/guides/templating.html#access-to-defined-tags-and-classes
> >
> > On Thu, Jul 12, 2012 at 1:08 PM, Ryan Coleman <r...@puppetlabs.com>
> > wrote:
> > > One way to approach this (for documentation) is to build a file
> > > resource backed by a template. The template would contain something
> > > like the following. It prints out all the classes defined in that
> > > agents catalog.
> > >
> > > <% classes.each do |klass| -%>
> > > The class <%= klass %> is defined
> > > <% end -%>
>
> that classes array is built up during parsing so when used like this it
> wont be
> complete till the end of the compile, so its not reliable.
>
> same reason that defined() doesnt work.
>
> Best way is to check classes.txt on the node.
>
> this code:
> -----
> class one { }
> class two { }
>
> include one
>
> notice(inline_template("<%= classes.inspect %>"))
>
> include two
>
> notice(inline_template("<%= classes.inspect %>"))
> -----
>
> does:
> -----
> notice: Scope(Class[main]): ["settings", "one"]
> notice: Scope(Class[main]): ["settings", "one", "two"]
> notice: Finished catalog run in 0.04 seconds
> -----
>
> you can see the contents depend on the parse order and will only be
> complete at the end of the compile.
>
> if you supply a class list from an ENC the whole ENC received list
> will be in there from the start though
>
> --
> 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.
>
>


-- 
Walter Heck

--
Check out my startup: Puppet training and consulting @
http://www.olindata.com
Follow @olindata on Twitter and/or 'Like' our Facebook page at
http://www.facebook.com/olindata

-- 
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.

Reply via email to