Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Ok I found a workaround, not great, but it works. Since 'datadir' doesn't accept an array, whereas 'hierarchy', I tried using relative path for hierarchy instead, like this:

$  cat /etc/puppetlabs/code/hiera.yaml
---
:backends:
  - yaml

:hierarchy:
  - "%{::role}"
  - common
  - "../../../hieradata/company_wide_hiera_data/common"      

:yaml:
  :datadir:
    - "/etc/puppetlabs/code/environments/%{::environment}/hieradata"

Notice my "../../../" hack. Next I created the following yaml data file:

/etc/puppetlabs/code/hieradata/company_wide_hiera_data/common.yaml

This approach worked. Does anyone else have a better approach?