Reorganize hieradata to match ansible variables

We are already organizing our hiera content basically the same way as
ansible needs for variables to be provided. If we reorganize the
directories slightly (to be coordinated with dirs on puppetmaster)
then we can have a single directory do double-duty.

Change-Id: I6ac90a7439ed8a5d9433d9526f37e44668b360ff
This commit is contained in:
Monty Taylor 2018-08-02 09:16:22 -05:00
parent f0cd27f060
commit 24eb60b34d
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
3 changed files with 16 additions and 13 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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"