On Fri, 1 Dec 2017, at 16:53, buoyant_puppy wrote:
> I'm trying to pull data from my cmdb into a variable, by downloading my 
> relevant data to a local json file and reading it in:
>   
> class get_cmdb {
>   file { "/tmp/${::hostname}.json":
>     source => "http://mycmdb.example.com/${::hostname}";
>   }
>   $mydata = loadjson("/tmp/${::hostname}.json")
> 
> The issue that the file in the first step is created on the agent, but
> the 
> loadjson attempts to read the file on the master.
> 
> How can I either read the file on the agent instead, or vice versa, fetch 
> the file on the master?
> 

All functions like foo() run on the master during compile.  It's a multi
phase process, the only way a node can influence the compile time is
using facts.

You could integrate your CMDB with puppet using a hiera data function
that could exist as a tier in your hierarchy

-- 
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/1512147574.2941891.1190871648.10BE647C%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to