I currently have these versions of puppet related packages installed:
# yum list installed | grep puppet
facter.x86_64 1:1.7.3-1.el6 @puppetlabs-products
hiera.noarch1.3.1-1.el6@puppetlabs
puppet.noarch 3.3.1-1.el6@puppetlabs
puppet-dashboard.noarch 1.2.23-1.el6 @puppetlabs-products
puppet-server.noarch3.3.1-1.el6@puppetlabs
puppetdb.noarch 1.5.2-1.el6@puppetlabs
puppetdb-terminus.noarch1.5.2-1.el6@puppetlabs
I also have :merge_behavior set to deeper
On Wednesday, February 26, 2014 6:08:51 PM UTC-5, Andrew wrote:
you need to use hiera 1.2 and enable deep merging
On 26 Feb 2014 22:19, paul@complex.com javascript: 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)
}
hiera.yaml:
---
:backends:
- json
:json:
:datadir: /etc/puppet/hiera
:merge_behavior: deeper
:hierarchy:
- nodes/%{::hostname}
- roles/%{::role}
- provider/%{::provider}
- provider/%{::provider}/virtual/virtual_%{::is_virtual}
- common
hiera/nodes/sandbox1.json:
{
php::augeas : {
php-allow_url_fopen : {
entry : PHP/allow_url_fopen,
value : On
}
}
}
hiera/roles/sandbox.json:
{
php::augeas : {
php-log_errors : {
entry : PHP/log_errors,
value : On
}
}
}
hiera/common.json:
{
php::augeas : {
php-date_timezone : {
entry : Date/date.timezone,
value : America/New_York
},
php-short_open_tag : {
entry : PHP/short_open_tag,
value : On
},
php-error_log : {
entry : PHP/error_log,
value : /var/log/php/php_error.log
}
}
}
In this configuration, *only php-allow_url_fopen **from the top-level
nodes hash is returned*. If I remove that nodes/sandbox1.json, it only
returns the php-log_errors from the next roles hiera level down.
Finally, if the nodes and roles json's are removed it will apply all three
from the common.json hash.
I have tried both native and deeper merge behaviors with the same result.
The strangest thing is that the hiera command line tool on the master
returns the correct hash:
# hiera -h php::augeas ::hostname=sandbox1 ::role=sandbox -c
/etc/puppet/hiera.yaml
{php-date_timezone=
{entry=Date/date.timezone, value=America/New_York},
php-short_open_tag={entry=PHP/short_open_tag, value=On},
php-error_log=
{entry=PHP/error_log, value=/var/log/php/php_error.log},
php-log_errors={entry=PHP/log_errors, value=On},
php-allow_url_fopen={entry=PHP/allow_url_fopen, value=On}}
--
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...@googlegroups.com javascript:.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/96454179-6cd7-4c54-9ec2-2bf553e319a9%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.
--
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/ddc1f9c0-8d30-43ad-856c-2fdf771f5b3e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.