From 488231e444865d0e1ca60dffb36d3b31c61a1946 Mon Sep 17 00:00:00 2001
From: Spencer Krum <nibz@spencerkrum.com>
Date: Mon, 16 Mar 2015 12:56:35 -0700
Subject: [PATCH] Setup hiera lookups to do common,group,fqdn

Before we start having ansible copy smaller hiera files around, we
need to be able to split common.yaml into smaller files and continue to
use our current structure. Configure hiera to look at group and fqdn
files in addition to common.

Change-Id: I32bf69f80c748668ca218a7a326c5737ec81fa7f
---
 .../openstack_project/files/puppetmaster/hiera.yaml    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/openstack_project/files/puppetmaster/hiera.yaml b/modules/openstack_project/files/puppetmaster/hiera.yaml
index 2a31856a58..f039df5647 100644
--- a/modules/openstack_project/files/puppetmaster/hiera.yaml
+++ b/modules/openstack_project/files/puppetmaster/hiera.yaml
@@ -1,8 +1,16 @@
 ---
 :hierarchy:
-  - "%{::operatingsystem}"
+  - fqdn/"%{::fqdn}"
+  - group/"%{group}" # no :: because group is set at nodescope
   - common
 :backends:
   - yaml
 :yaml:
   :datadir: "/etc/puppet/hieradata/%{environment}"
+
+
+# File directory structure
+# /etc/puppet/hieradata/production/
+# /etc/puppet/hieradata/production/fqdn/afs01.openstack.org.yaml  #highest priority
+# /etc/puppet/hieradata/production/group/afs.yaml                 #middle priority
+# /etc/puppet/hieradata/production/common.yaml                    #lowest priority