Hi

Can't you just set a fallback or default value in the manifest?

Example: 
`$attr = hiera('other::attr','fallback')`

http://docs.puppetlabs.com/hiera/1/puppet.html#hiera-lookup-functions

Julian

> On 18 Sep 2015, at 23:36, Joao Morais <[email protected]> wrote:
> 
> 
> Hello list. I am using the hiera() lookup function in order to query some few 
> attributes from a http backend. Something like this:
> 
>   common.yaml
>   ---
>   ...
>   class::attr: "%{hiera('other::attr')}"
> 
> This works very well if other::attr is defined, but an empty string is 
> returned in the lookup above if the other::attr isn't found. The hiera() 
> function on the manifest fails the compilation if I do the same query, which 
> is what I'd expect from the lookup above.
> 
> Is there a way to enforce the declaration of the other::attr when using 
> hiera() lookup function inside the hieradata?
> 
> -- 
> 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/55FC83C6.7080007%40joaomorais.com.br.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/0BAFA81B-B030-4D51-977C-9191182ED893%40mailtower.ch.
For more options, visit https://groups.google.com/d/optout.

Reply via email to