I was able to solve this.  The facts were being communicated correctly, 
however the custom facts had a additional newline at the end.  So I just 
needed to clean up the whitespace.

 fact.last.strip

Once the fact was cleaned, hiera lookups started to work again.




On Monday, May 6, 2013 7:22:40 PM UTC-7, Corey Osman wrote:
>
> Hi,
>
> Before I begin, my environment consists of a standard master/client config 
> with the exception that all my clients run under a non-root user.  I have 
> to use non-root so I can't simply restart under root to fix the problem.
>
> Master -> 3.1.1
> Client  -> 2.7.17
>
> using mostly the hiera() function in my classes.
>
> problem:
>
> I have run into an issue today where my custom fact is not being passed to 
> hiera in order to determine which hiera file to use (see hierarchy).  The 
> custom fact is definitely defined what it should be but its almost as if it 
> has a differently scope then say a root level custom fact.  Because of this 
> hiera data is coming up undefined which causes my classes to fail.
>
> $myvar = hiera('var-name')   --> should use custom_env and custom_release 
> to help determine where the variable is defined in hiera.
>
> Are custom facts from non root users simply not relayed to hiera?
>
> :hierarchy:
>   - nodes/%{::fqdn}
>   - releases/%{custom_release}
>   - env/%{custom_env}
>   - common
>
>
>
> I have put a bandaid fix in for now which sets these variables via top 
> scope assignment in one of my classes and allows me to control everything 
> from hiera instead of using custom facts.  However, I am not sure if this 
> follows good puppet coding practices when using hiera, since I am using 
> hiera to feed hiera.  I don't want to have to define these variables for 
> every node.
>
> bandaid fix:
> # this is a top scope variable that is currently a hack to fix an unknown 
> bug with hiera and local puppet facts
> $custom_env = hiera('custom_env')  --> defined under nodes/nodename
> $custom_release = hiera('custom_release')   --> defined under 
> nodes/nodename
> class roles::specialapp(
>
>   )
>
> {
>     include specialapp_profile
>
> }
>
>
> If this is a new bug, I'll be happen to file a ticket.
>
> Thanks,
>
> Corey Osman
> [email protected]
>
>
>
>
>
>
>  
>

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to