I have the following Hiera.yaml
---
:backends:
- yaml
:hierarchy:
- defaults
- "%{clientcert}"
- "%{environment}"
- "users/%{usertype}"
- global
:yaml:
:datadir:
The usertype variable is defined in my Foreman parameters and is different for each host group type.
The idea is that the user list for each host group type will be in a separate file in a subdirectory.
However in order to get files of the name "users/%{usertype}" I needed to create files in the base hiera directory with contents
---
to make them valid yaml files.
Only once I did that did things work as expected. I am not sure why though. This can be useful now that I think about it, but it was unexpected.
Terrence