Re: [Puppet Users] Re: Hiera isn't merging hashes

2017-08-11 Thread Henrik Lindberg

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,
paul@complex.com 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 


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 puppet-users+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b3d6fca1-711e-406c-a089-37f28b2dde8a%40googlegroups.com 
.

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 puppet-users+unsubscr...@googlegroups.com.
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.


[Puppet Users] Re: Hiera isn't merging hashes

2017-08-11 Thread Leadel Ngalame
Hey @Charlie, thanks for this post. I had been looking for this 
functionality for a while now. It works like a charm

Am Donnerstag, 27. Februar 2014 04:08:27 UTC+1 schrieb Charlie Sharpsteen:
>
> On Wednesday, February 26, 2014 2:19:23 PM UTC-8, paul@complex.com 
> 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
>
> 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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b3d6fca1-711e-406c-a089-37f28b2dde8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Hiera isn't merging hashes

2014-02-27 Thread paul . lewis
That explains a lot, thanks!

On Wednesday, February 26, 2014 10:08:27 PM UTC-5, Charlie Sharpsteen wrote:
>
> On Wednesday, February 26, 2014 2:19:23 PM UTC-8, paul@complex.comwrote:
>>
>> 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
>
> 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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5a5d7c53-043f-4ab3-9f92-ee80d9e7ff1b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Hiera isn't merging hashes

2014-02-26 Thread Charlie Sharpsteen
On Wednesday, February 26, 2014 2:19:23 PM UTC-8, paul@complex.com 
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

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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/646bc467-b109-4828-baa8-74af6bed6426%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.