I'm using:
CentOS 7.1
Puppet 3.6.2
Hiera 1.3.4
I'm following some very simple examples and learning how to use hiera. One
thing has me confused. Is sometimes I see examples having :: and some not.
I have three files in use here.
*____________*
*my hiera.yaml file*
---
:backends:
- yaml
:hierarchy:
- "nodes/%{::fqdn}"
- "env/%{::env}"
- common
:yaml:
:datadir: /etc/puppet/hieradata
__________
*My /etc/puppet/hieradata/common.yaml*
---
ldap_servers:
- 10.1.1.2
- 10.1.1.3
___________
*My /etc/puppet/hieradata/env/test.yaml*
---
ldap_servers:
- 10.1.1.4
_______________
If I run "hiera ldap_servers" I get
["10.1.1.2", "10.1.1.3"]
If I run "hiera ldap_servers env=test" I STILL get
["10.1.1.2", "10.1.1.3"]
I would have expected
["10.1.1.4"]
Many examples I have seen, including the one in "Extending Puppet, by
Alessandro Franceschi" Seem to says this should work (the env part).
I mucked around with it and removed changed my - "env/%{::env}" line to
- "env/%{env}" in my hiera.yaml file. And presto it works as expected now,
just returning the 10.1.1.4
So my question is, what is the "::" doing? I see many examples with and
without it.
Thanks
--
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/8314abdd-d125-4c00-946f-986e5105445d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.