On 09/08/17 14:01, Leadel Ngalame wrote:
Hey @Charlie, thanks for this post. I had been looking for this functionality for a while now. It works like a charm


Note that you found very old information. While it still works you want to read the latest documentation for hiera https://docs.puppet.com/hiera/3.3/puppet.html and note that from Puppet 4.9 and onwards the hiera 3 version is deprecated in favor for hiera 5. The new version (5) resides in puppet itself.

Instead of using the hiera_xxx functions you should use the lookup() function.

Just wanted to let you know to avoid disappointment when you have to change.

Best,
- henrik

Am Donnerstag, 27. Februar 2014 04:08:27 UTC+1 schrieb Charlie Sharpsteen:

    On Wednesday, February 26, 2014 2:19:23 PM UTC-8,
    [email protected] wrote:

        I have been doing some experimenting with Puppet + Hiera with
        some of my hashes, but when it is going through my hierarchy it
        is returning whatever hash it hits first and skipping the others.

        For my node 'sandbox1'

        sandbox.pp:

            node /^sandbox\d+/ {
               class { 'php':}
               notify { 'PHP hash':
                 message => hiera('php::augeas',{})
               }
               $php_settings = hiera('php::augeas',{})
               create_resources('php::augeas',$php_settings)
            }



    The `hiera` lookup function only returns the first key it finds ---
    which is the behavior you are observing. For hash merge lookup, you
    will need to use the `hiera_hash` function in your manifest instead
    of `hiera`.

    For full details, see the docs on Hiera lookup functions:

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

    Hope this helps!

    -Charlie

--
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] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b3d6fca1-711e-406c-a089-37f28b2dde8a%40googlegroups.com <https://groups.google.com/d/msgid/puppet-users/b3d6fca1-711e-406c-a089-37f28b2dde8a%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
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/omk4a4%2451o%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to