Hi guys,
i have a hiera.yaml config file like this:
---
:hierarchy:
- %{env}/%{tmp_module_name}
- %{env}/%{tmp_module_name}.common
:backends:
- yaml
:yaml:
:datadir: '/etc/puppet/hieradata'
I also have a test/some_module.yaml file like this:
---
db:
root : pass
port : '3306'
I am also using the hiera function from a template like this
class.pp
$::class::var='db'
template.erb
<%= scope.function_hiera([var]) %>
and that returns as expected the 'db' hash...
however , I would like to query the yaml file directly from the hiera
function with something like:
scope.function_hiera([var:root]), so to have access directly to the
root:pass pair. but that doesnt seem to work.
I've tried several possibilities, eg: ([var:'root']), ([$var::'root']),
([$::class::var:root]), ([var:['root']]) without success,
Now i know that something like <%= scope.function_hiera([var])['root']
would work!
The problem with this approach is that the next level in the hierarchy
would never be reached since the 'db' key will always be located in the
first level... but what if I would like to use something like this:
First search level:
---
db:
root : pass
port : '3999'
Second search level
---
db:
root : pass
port : '3999'
path : 'foo'
then the path:foo pair would never be located...
Btw, are there any plans to fix this soon:
http://projects.puppetlabs.com/issues/14985
thanks in advance,
evelio
Using ubuntu 12.04 LTS
Package: puppet
Version: 3.0.1-1puppetlabs1
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/wWVVXkBB-ywJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.