On 15/05/16 23:53, Corey Osman wrote:
Hi,

I want to retrieve server_facts as documented below but the puppet node
face doesn’t seem to create a variable called $server_facts in the facts
hash.

https://docs.puppet.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#serverfacts-variable


It is the compiler indirection that sets those by doing add_server_facts on the node. It first computes them by calling the private method set_server_facts, which just remembers them in the compiler.

Then, when the compiler (the real one) starts compiling it ensure that the variables are set up in top scope.

To get them (without copy/paste of the code in question and doing it yourself, it is around 10-20 lines of code) you would probably need to do a dummy compilation via a find catalog for a dummy node. Then get the data from the node.

Not pretty.


Is there a way to get this data via the node face?

ie. puppet node find puppetdev.localdomain —terminus rest —render-as yaml



Does not seem so. And why would it? The server facts are not part of the node (even if technically they are delivered that way from one place to another inside puppet - but that is mainly because it is hard to pass information around when the indirector is involved).

What is it you are trying to do?

- henrik

--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
You received this message because you are subscribed to the Google Groups "Puppet 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/005974d9-0f9b-882e-83b8-edd651bd2bb5%40puppetlabs.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to