Re: [Puppet Users] Accessing the list of classes assigned to a node from within puppet

2019-08-07 Thread John Warburton
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 <
puppet-users@googlegroups.com> 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  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
> .
>
> I can't see to find the equivalent in puppet 6.x. Nothing in the built in
> variables doc
> 
>
> Am I looking in the wrong place or do I have to try and access through the
> internal API
> 
> ?
>
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/230b487d-b9ae-42c3-a686-826a5c8caa89%40googlegroups.com
> 
> .
>
> --
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/6E44817D-4C94-4800-BDA0-EE89DF2B0405%40icloud.com
> 
> .
>


-- 
John Warburton
Ph: 0417 299 600
Email: jwarbur...@gmail.com

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAAJLFxXBW5m1LV7so29E4ACes%3DjWuR8A4K_AFcfN5Us8CBp63g%40mail.gmail.com.


Re: [Puppet Users] Accessing the list of classes assigned to a node from within puppet

2019-08-07 Thread 'Dan White' via Puppet Users
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  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.
> 
> I can't see to find the equivalent in puppet 6.x. Nothing in the built in 
> variables doc
> 
> Am I looking in the wrong place or do I have to try and access through the 
> internal API?
> 
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/230b487d-b9ae-42c3-a686-826a5c8caa89%40googlegroups.com.

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6E44817D-4C94-4800-BDA0-EE89DF2B0405%40icloud.com.