Hi,

I've been trying to debug my slow Puppet runs since using hiera-gpg 
(https://groups.google.com/d/topic/puppet-users/CRu_RolrX_8/discussion) and 
found some unexpected (by me) behaviour in hiera.

It seems that hiera does a lookup for any class parameters, even if they 
are not hiera functions.

e.g. say I have a class:

class hieratest($default_value="default") {
>     file { "/tmp/hieratest.txt":
>         ensure => present,
>         content => $default_value,
>     }
> }
>

and in my nodes.pp I have

include hieratest
>

If I run puppetmaster in the foreground and do a 'puppet agent -t' I can 
see that hiera is looking through my entire hierarchy for 
hieratest::default_value. I would not expect hiera to do this unless I had 
put:

class hieratest($default_value=hiera('default_value', "default")) { ... }
>

I noticed that if I include the 'default_value' var in my hiera common.yaml 
it is not found / used, however if I put 'hieratest::default_value' in then 
it is used. Is this the expected behaviour? If so is there any way to 
include a default parameter in a class without it doing a hiera lookup? 
This seems to have quite a major impact on my catalog compile time once I 
add the gpg backend.


Cheers,

Jon

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
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