From 7264b63d10ca828aff611d94aa730cc5451a7a5c Mon Sep 17 00:00:00 2001 From: Reid Vandewiele Date: Wed, 15 Nov 2017 09:24:40 -0800 Subject: Enable Hiera 5 This commit enables the control repo to use Hiera 5 environment-level hiera hierarchy. This means adding a hiera.yaml to the repo, and moving hieradata/ => data/. We should do this to the control-repo template new customers base off of because in a Hiera 5 world, the global hiera.yaml should be very minimal (possibly even ONLY having the console level), and everything else (nodes, common) belongs in the environment hiera.yaml. This control-repo template is how people start using Puppet. It should reflect using our most modern technologies. --- data/common.yaml | 2 ++ data/nodes/example-node.yaml | 1 + hiera.yaml | 12 ++++++++++++ hieradata/common.yaml | 2 -- hieradata/nodes/example-node.yaml | 1 - 5 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 data/common.yaml create mode 100644 data/nodes/example-node.yaml create mode 100644 hiera.yaml delete mode 100644 hieradata/common.yaml delete mode 100644 hieradata/nodes/example-node.yaml diff --git a/data/common.yaml b/data/common.yaml new file mode 100644 index 0000000..2baa62b --- /dev/null +++ b/data/common.yaml @@ -0,0 +1,2 @@ +--- +message: "This node is using common data" diff --git a/data/nodes/example-node.yaml b/data/nodes/example-node.yaml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/data/nodes/example-node.yaml @@ -0,0 +1 @@ +--- diff --git a/hiera.yaml b/hiera.yaml new file mode 100644 index 0000000..912ba45 --- /dev/null +++ b/hiera.yaml @@ -0,0 +1,12 @@ +--- +version: 5 + +defaults: + datadir: "data" + +hierarchy: + - name: 'Yaml backend' + data_hash: yaml_data + paths: + - "nodes/%{trusted.certname}.yaml" + - 'common.yaml' diff --git a/hieradata/common.yaml b/hieradata/common.yaml deleted file mode 100644 index 2baa62b..0000000 --- a/hieradata/common.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -message: "This node is using common data" diff --git a/hieradata/nodes/example-node.yaml b/hieradata/nodes/example-node.yaml deleted file mode 100644 index ed97d53..0000000 --- a/hieradata/nodes/example-node.yaml +++ /dev/null @@ -1 +0,0 @@ ---- -- cgit v1.2.3