Cool I will look into.   Concerning support, I got the idea to use it
from the hiera documentation:

   https://docs.puppetlabs.com/hiera/1/variables.html#using-lookup-functions

And as I said with the hiera command line it worked:

    $ hiera resolvconf::nameserver -c puppet.yaml ::site=corp
::role=dev ::hwtype=vagrant
    ["10.135.82.132", "10.35.249.52", "10.35.249.41"]

Such that I think it may be bug.

Thanks for the anchors info though.   Best...James

On Tue, Jan 13, 2015 at 10:47 AM, Stephen Marlow <tega...@gmail.com> wrote:
> I can't say I've ever seen nested hiera lookups, and I don't know if they're
> supported.
>
> If these values are all in the same yaml file you might have better luck
> using anchors and references
> (https://en.wikipedia.org/wiki/YAML#Repeated_nodes). I think it would work
> for all of the above entries except for vagrant-dns::search, which I'm not
> sure how to tackle with just YAML.
>
> On Tue, Jan 13, 2015 at 10:09 AM, James Oden <james.o...@gmail.com> wrote:
>>
>> I had two puppet modules that needed the same data, so I tried to define
>> the data once in hiera and then refer to the first definition via the
>> hiera() function.   When I did this as soon as puppet began loading the
>> module that used one of these variables it hung.    I checked using the
>> hiera CLI and it could actually resolve the variables just fine.   When I
>> changed the the hiera file to not use variables but instead copied the
>> actual strings wherever needed it, puppet worked just fine.   Also, I did a
>> mixed solution where one of the modules had static data and the other did
>> the hiera lookup, and it got further but hung on the module that was doing
>> the lookups.
>>
>> Here is the hiera data I'm referring too:
>>
>>    dns1:                    '10.135.82.132'
>>    dns2:                    '10.35.249.52'
>>    dns3:                    '10.35.249.41'
>>    dns_search1:             'us.blah.com'
>>    dns_search2:             'labs.nc.blather.com'
>>    resolvconf::nameserver:
>>        - "%{hiera('dns1')}"
>>        - "%{hiera('dns2')}"
>>        - "%{hiera('dns3')}"
>>    resolvconf::search:
>>        - "%{hiera('dns_search1')}"
>>        - "%{hiera('dns_search2')}"
>>    vagrant-dns::device: 'enp0s3'
>>    vagrant-dns::dns1:   "%{hiera('dns1')}"
>>    vagrant-dns::dns2:   "%{hiera('dns2')}"
>>    vagrant-dns::dns3:   "%{hiera('dns3')}"
>>    vagrant-dns::search: "%{hiera('dns_search1')} %{hiera('dns_search2')}"
>>
>> I am using puppet 3.4.2.
>>
>> Is this  a known problem?   Am I doing something stupid?   I tried
>> googling for this but came up nil.
>>
>> Thanks...James
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/6c647668-c31d-4952-9349-4f7011b44def%40googlegroups.com.
>> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CALGSqjLkGNKahe9rT_7mNAMAnqk4cuSMLkZ65HQDeJnzDGQiBw%40mail.gmail.com.
>
> 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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAPWHxfK3ZVK8rbL4F6e%2BKd2XD_b9fq6R7hJzJaKNkcqg5gY7bQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to