diff --git a/library/puppet_get_hiera_file_list b/library/puppet_get_hiera_file_list index 79dbe54..c30ce91 100644 --- a/library/puppet_get_hiera_file_list +++ b/library/puppet_get_hiera_file_list @@ -51,9 +51,9 @@ def main(): ) p = module.params - paths = ['group/%s.yaml' % f for f in p['groups'] ] - paths.append('common.yaml') - paths.append('fqdn/%s.yaml' % p['fqdn']) + paths = ['group_vars/%s.yaml' % f for f in p['groups'] ] + paths.append('group_vars/all.yaml') + paths.append('host_vars/%s.yaml' % p['fqdn']) good_paths = [] for path in paths: diff --git a/tasks/main.yml b/tasks/main.yml index 699013c..2c82b5d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,8 +44,8 @@ group: root mode: 0700 with_items: - - fqdn - - group + - group_vars + - host_vars - name: make file list puppet_get_hiera_file_list: diff --git a/templates/hiera.yaml.j2 b/templates/hiera.yaml.j2 index 23395a2..496fb5a 100644 --- a/templates/hiera.yaml.j2 +++ b/templates/hiera.yaml.j2 @@ -1,15 +1,18 @@ --- :hierarchy: - # Use private hieradata first + # Use private hieradata first. Align naming with ansible so that the private + # data can exist in a single copy for both ansible and puppet # Puppet3 paths - - "hieradata/%{::environment}/fqdn/%{::fqdn}" - - "hieradata/%{::environment}/group/%{group}" # no :: because group is set at nodescope - - "hieradata/%{::environment}/common" + - "hieradata/%{::environment}/host_vars/%{::fqdn}" + - "hieradata/%{::environment}/group_vars/%{group}" # no :: because group is set at nodescope + - "hieradata/%{::environment}/group_vars/all" # 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}/hieradata/host_vars/%{::fqdn}" + - "%{::environment}/hieradata/group_vars/%{group}" # no :: because group is set at nodescope + - "%{::environment}/hieradata/group_vars/all" + # Use public hieradata second, also be environmentally aware. Keep this + # in the old structure so that we don't have to do a dance. There isn't much + # here, and it can be transferred piecemeal. - "%{::environment}/hiera/fqdn/%{::fqdn}" - "%{::environment}/hiera/group/%{group}" # no :: because group is set at nodescope - "%{::environment}/hiera/common"