Thanks Dan But we are not using an ENC, so "classes" is not set. The lookup in site.pp yields: Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Function lookup() did not find a value for the name 'classes'
I am programatically looking for the content of /opt/puppetlabs/puppet/cache/state/classes.txt Thanks for looking Regards John On Thu, 8 Aug 2019 at 13:11, 'Dan White' via Puppet Users < [email protected]> wrote: > How about a variation on this : > # In site.pp, outside of any node definitions and below any top-scope > variables: lookup('classes', Array[String], 'unique').include > > Lose the “include” and you have : > $class_list = lookup('classes', Array[String], 'unique') > > —————————————————————————————————- > > "Sometimes I think the surest sign that intelligent life exists elsewhere > in the universe is that none of it has tried to contact us." > > Bill Waterson (Calvin & Hobbes) > > On Aug 7, 2019, at 9:48 PM, John Warburton <[email protected]> wrote: > > Hi Everyone > > Back in the day of 2.x/3.x, I used to access the "classes" top scope > variable and dump into templates - like this > <https://groups.google.com/d/msg/puppet-users/R-y4bPTna24/BHWhi4WOJ6oJ>. > > I can't see to find the equivalent in puppet 6.x. Nothing in the built in > variables doc > <https://puppet.com/docs/puppet/6.7/lang_facts_and_builtin_vars.html> > > Am I looking in the wrong place or do I have to try and access through the > internal API > <https://www.rubydoc.info/gems/puppet/Puppet/Resource/Catalog#classes-instance_method> > ? > > Thanks > > John > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/230b487d-b9ae-42c3-a686-826a5c8caa89%40googlegroups.com > <https://groups.google.com/d/msgid/puppet-users/230b487d-b9ae-42c3-a686-826a5c8caa89%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/6E44817D-4C94-4800-BDA0-EE89DF2B0405%40icloud.com > <https://groups.google.com/d/msgid/puppet-users/6E44817D-4C94-4800-BDA0-EE89DF2B0405%40icloud.com?utm_medium=email&utm_source=footer> > . > -- John Warburton Ph: 0417 299 600 Email: [email protected] -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAAJLFxXBW5m1LV7so29E4ACes%3DjWuR8A4K_AFcfN5Us8CBp63g%40mail.gmail.com.
