Buenas!
Nomás para referencia, yo hice la siguiente prueba y anduvo. Hablando con Juan Pablo, parece que esto fue un bug en Hiera 1.2.0, que era la versión que él tenía en ese momento. Con un upgrade de hiera se solucionó el asunto, aparentemente.
De paso les comento, que estamos en IRC en freenode, #puppet-es cualquier pregunta que quieran hacer :)
******
# puppet --version
3.4.2
# hiera --version
1.2.1
******
******
# gem list --local deep_merge
*** LOCAL GEMS ***
deep_merge (1.0.0)
*******
*******
hiera.yaml
---
:backends:
- yaml
:hierarchy:
- hosts/%{fqdn}
- global
:yaml:
:datadir: '/opt/puppet/data/'
:merge_behavior: 'deeper'
*******
*******
global.yaml
globant::firewall::custom::allow:
"103 Allow tcp apache":
"dport": "83"
*******
*******
puppettest.domain.net.yaml
globant::firewall::custom::allow:
"100 Allow tcp apache":
"dport": "80"
"101 Allow tcp tomcat":
"dport": "81"
********
********
DEBUG: Thu Jan 16 10:12:31 -0300 2014: Hiera YAML backend starting
DEBUG: Thu Jan 16 10:12:31 -0300 2014: Looking up globant::firewall::custom::allow in YAML backend
DEBUG: Thu Jan 16 10:12:31 -0300 2014: Found globant::firewall::custom::allow in hosts/
puppettest.domain.netDEBUG: Thu Jan 16 10:12:31 -0300 2014: Looking for data source global
DEBUG: Thu Jan 16 10:12:31 -0300 2014: Found globant::firewall::custom::allow in global
{"100 Allow tcp apache"=>{"dport"=>"80", "source"=>"
0.0.0.0/1"}, "101 Allow tcp tomcat"=>{"dport"=>"81", "source"=>"
0.0.0.2/1"}, "103 Allow tcp apache"=>{"dport"=>"83", "source"=>"
0.0.0.3/1"}}
********
********
hashtest/manifests/init.pp
class hashtest {
$hash = hiera_hash('globant::firewall::custom::allow')
file { '/tmp/glog.yaml':
ensure => file,
content => "$hash",
}
}
********
********
# puppet apply modules/hashtest/tests/init.pp --debug | grep hiera
Debug: hiera(): Hiera YAML backend starting
Debug: hiera(): Looking up globant::firewall::custom::allow in YAML backend
Debug: hiera(): Looking for data source production
Debug: hiera(): Cannot find datafile production.yaml, skipping
Debug: hiera(): Looking for data source RedHat
Debug: hiera(): Cannot find datafile RedHat.yaml, skipping
Debug: hiera(): Looking for data source global
Debug: hiera(): Found globant::firewall::custom::allow in global
Debug: Using settings: adding file resource 'hiera_config': 'File[/etc/puppet/hiera.yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :backup=>false, :path=>"/etc/puppet/hiera.yaml"}'
Debug: /File[/etc/puppet/hiera.yaml]: Autorequiring File[/etc/puppet]
********
********
# cat /tmp/glog.yaml
101 Allow tcp tomcatsource0.0.0.2/1dport81
103 Allow tcp apachesource0.0.0.3/1dport83
100 Allow tcp apachesource0.0.0.0/1dport80
********