summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--library/puppet_get_hiera_file_list6
-rw-r--r--tasks/main.yml4
-rw-r--r--templates/hiera.yaml.j219
3 files changed, 16 insertions, 13 deletions
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():
51 ) 51 )
52 p = module.params 52 p = module.params
53 53
54 paths = ['group/%s.yaml' % f for f in p['groups'] ] 54 paths = ['group_vars/%s.yaml' % f for f in p['groups'] ]
55 paths.append('common.yaml') 55 paths.append('group_vars/all.yaml')
56 paths.append('fqdn/%s.yaml' % p['fqdn']) 56 paths.append('host_vars/%s.yaml' % p['fqdn'])
57 57
58 good_paths = [] 58 good_paths = []
59 for path in paths: 59 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 @@
44 group: root 44 group: root
45 mode: 0700 45 mode: 0700
46 with_items: 46 with_items:
47 - fqdn 47 - group_vars
48 - group 48 - host_vars
49 49
50 - name: make file list 50 - name: make file list
51 puppet_get_hiera_file_list: 51 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 @@
1--- 1---
2:hierarchy: 2:hierarchy:
3 # Use private hieradata first 3 # Use private hieradata first. Align naming with ansible so that the private
4 # data can exist in a single copy for both ansible and puppet
4 # Puppet3 paths 5 # Puppet3 paths
5 - "hieradata/%{::environment}/fqdn/%{::fqdn}" 6 - "hieradata/%{::environment}/host_vars/%{::fqdn}"
6 - "hieradata/%{::environment}/group/%{group}" # no :: because group is set at nodescope 7 - "hieradata/%{::environment}/group_vars/%{group}" # no :: because group is set at nodescope
7 - "hieradata/%{::environment}/common" 8 - "hieradata/%{::environment}/group_vars/all"
8 # Puppet4 paths 9 # Puppet4 paths
9 - "%{::environment}/hieradata/fqdn/%{::fqdn}" 10 - "%{::environment}/hieradata/host_vars/%{::fqdn}"
10 - "%{::environment}/hieradata/group/%{group}" # no :: because group is set at nodescope 11 - "%{::environment}/hieradata/group_vars/%{group}" # no :: because group is set at nodescope
11 - "%{::environment}/hieradata/common" 12 - "%{::environment}/hieradata/group_vars/all"
12 # Use public hieradata second, also be environmentally aware 13 # Use public hieradata second, also be environmentally aware. Keep this
14 # in the old structure so that we don't have to do a dance. There isn't much
15 # here, and it can be transferred piecemeal.
13 - "%{::environment}/hiera/fqdn/%{::fqdn}" 16 - "%{::environment}/hiera/fqdn/%{::fqdn}"
14 - "%{::environment}/hiera/group/%{group}" # no :: because group is set at nodescope 17 - "%{::environment}/hiera/group/%{group}" # no :: because group is set at nodescope
15 - "%{::environment}/hiera/common" 18 - "%{::environment}/hiera/common"