node /^sandbox\d+/ {
class { 'php':}
notify { 'PHP hash':
message => hiera('php::augeas',{})
}
$php_settings = hiera('php::augeas',{})
create_resources('php::augeas',$php_settings)
}
---:backends:- json:json::datadir: /etc/puppet/hiera:merge_behavior: "deeper":hierarchy:- "nodes/%{::hostname}"- "roles/%{::role}"- "provider/%{::provider}"- "provider/%{::provider}/virtual/virtual_%{::is_virtual}"- common
{"php::augeas" : {"php-allow_url_fopen" : {"entry" : "PHP/allow_url_fopen","value" : "On"}}}
{"php::augeas" : {"php-log_errors" : {"entry" : "PHP/log_errors","value" : "On"}}}
{"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"}}}
# 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 need to use hiera 1.2 and enable deep merging
--
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.
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.
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)
}