Re: [Puppet Users] Hiera in custom facts?

2013-12-08 Thread Lee Dormon
Excellent, thanks guys, had a feeling I was doing it wrong, just wanted to make sure. Thanks Lee On 8 Dec 2013, at 12:12, Johan De Wit wrote: > Trying to explain a little bit more, here is the flow of a puppet run on a > node : > > On the node : agent starts - gathers all the facts. ( fac

Re: [Puppet Users] Hiera in custom facts?

2013-12-08 Thread Johan De Wit
Trying to explain a little bit more, here is the flow of a puppet run on a node : On the node : agent starts - gathers all the facts. ( facter -p if you want to see what is gathered) Node sends it to the puppet master Puppet masters compiles the catalog, using those facte, and looking up all

Re: [Puppet Users] Hiera in custom facts?

2013-12-06 Thread Felix Frank
Again: You *cannot* get hiera values into facter, nor would that be particularly useful (at least from the master's perspective). On 12/06/2013 04:08 PM, leed wrote: > Thanks for your response, I'd tried adding that to the global scope > (confirmed with a notify), but this doesn't seem to be passe

Re: [Puppet Users] Hiera in custom facts?

2013-12-06 Thread leed
On Friday, 6 December 2013 14:27:47 UTC, Felix.Frank wrote: > > > If you want to use $clustername instead of hiera("clustername"), just > add this to the global scope of your manifest: > > $clustername = hiera("clustername") > Thanks for your response, I'd tried adding that to the global scope

Re: [Puppet Users] Hiera in custom facts?

2013-12-06 Thread Felix Frank
Hi, this is in fact not the right approach. Facts are evaluated on the agent side, while hiera typically belongs to the master side only. If you want to use $clustername instead of hiera("clustername"), just add this to the global scope of your manifest: $clustername = hiera("clustername") HTH

[Puppet Users] Hiera in custom facts?

2013-12-06 Thread leed
Hello all So is it possible to use hiera data in a custom facts? I'm probably going about this all wrong, but I was hoping something like this would work. Facter.add("cluster_name") do setcode do hiera('clustername') end end But I get a lot of Could not retrieve cluster_name: undefined