Fix hieradata lookup paths

This requires we get the magical symlink between hieradata in
/opt/system-config to line up with the actual on disk environment
specific hiera location which differs between puppet 3 and 4.

Change-Id: Id4d7a0af72efddb758d94c6437bb1c331d12f406
This commit is contained in:
Clark Boylan 2018-04-25 12:25:59 -07:00
parent c95f026c14
commit 7fbe25598b
2 changed files with 6 additions and 1 deletions

View File

@ -72,7 +72,7 @@
- name: ensure hieradata manifest link is present
file:
src: "{{ hieradata }}"
src: "{{ '/etc/puppet/hieradata' if puppet_version == '3' else '/etc/puppetlabs/code/environments' }}"
dest: "{{ manifest_base }}/hieradata"
state: link
when: copy_hieradata

View File

@ -1,9 +1,14 @@
---
:hierarchy:
# Use private hieradata first
# Puppet3 paths
- "hieradata/%{::environment}/fqdn/%{::fqdn}"
- "hieradata/%{::environment}/group/%{group}" # no :: because group is set at nodescope
- "hieradata/%{::environment}/common"
# Puppet4 paths
- "%{::environment}/hieradata/fqdn/%{::fqdn}"
- "%{::environment}/hieradata/group/%{group}" # no :: because group is set at nodescope
- "%{::environment}/hieradata/common"
# Use public hieradata second, also be environmentally aware
- "%{::environment}/hiera/fqdn/%{::fqdn}"
- "%{::environment}/hiera/group/%{group}" # no :: because group is set at nodescope