Hi List,
I am experimenting with different hiera hierarchy's through the hiera
command line. I am passing in different facts to simulate different nodes.
In the beginning I would manually pass them in as parameters on the
command line after a while when I wanted to pass in more and more facts I
decided to use the YAML scope file option.
This does not seem to work when I use the :: notation in the hieral.yaml
under the hierarchy. I have simplified my hierarchy to demonstrate the
issue. The relevant files look like:
**********************************************
$ ls -R
.:
facts.yaml hiera.yaml hieradata
./hieradata:
common.yaml node
./hieradata/node:
creator.mgnt.local.yaml
**********************************************
$ cat hiera.yaml
---
:backends:
- yaml
:yaml:
:datadir: ./hieradata
:hierarchy:
- "node/%{::fqdn}"
- common
**********************************************
$ cat hieradata/common.yaml
---
ip: '192.168.0.1'
**********************************************
$ cat hieradata/node/creator.mgnt.local.yaml
---
ip: '10.0.0.1'
**********************************************
$ cat facts.yaml
---
fqdn: "creator.mgnt.local"
If I manually pass the facts on the command line it works
$ hiera -c hiera.yaml ip ::fqdn=creator.mgnt.local -d
DEBUG: 2014-01-09 22:19:48 +1100: Hiera YAML backend starting
DEBUG: 2014-01-09 22:19:48 +1100: Looking up ip in YAML backend
DEBUG: 2014-01-09 22:19:48 +1100: Looking for data source
node/creator.mgnt.local
DEBUG: 2014-01-09 22:19:48 +1100: Found ip in node/creator.mgnt.local
10.0.0.1
However if I use a file which contains the facts it doesn't work
$ hiera -c hiera.yaml ip -y facts.yaml -d
DEBUG: 2014-01-09 22:26:31 +1100: Hiera YAML backend starting
DEBUG: 2014-01-09 22:26:31 +1100: Looking up ip in YAML backend
DEBUG: 2014-01-09 22:26:31 +1100: Looking for data source common
DEBUG: 2014-01-09 22:26:31 +1100: Found ip in common
192.168.0.1
In the facts file I have have tried it also declaring it like "::fqdn" but
that also does not work. Is there an option to bring the factor variables
into the global scope?
Thanks,
Peter
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/420abd32-c607-4374-ad34-64c999487ed7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.