FAQ
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+unsubscribe@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.

Search Discussions

  • Craig Dunn at Feb 21, 2013 at 12:56 pm

    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:
    What you are describing is the new data binding features that came out
    in Puppet 3.0

    http://docs.puppetlabs.com/puppet/3/reference/release_notes.html#automatic-data-bindings-for-class-parameters

    Regards
    Craig

    --
    Craig Dunn
    Professional Services
    Puppet Labs Inc.
    http://www.puppetlabs.com

    --
    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+unsubscribe@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.
  • Jon Ward at Feb 21, 2013 at 1:22 pm
    Ah I missed that, thanks Craig.


    On Thursday, February 21, 2013 12:43:12 PM UTC, Jon Ward wrote:

    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+unsubscribe@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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedFeb 21, '13 at 12:43p
activeFeb 21, '13 at 1:22p
posts3
users2
websitepuppetlabs.com

2 users in discussion

Jon Ward: 2 posts Craig Dunn: 1 post

People

Translate

site design / logo © 2022 Grokbase