diff --git a/data/common.yaml b/data/common.yaml index cf60938..2ed85da 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -1,4 +1,5 @@ --- + classes: [] users: 'john': comment: 'John Arundel' diff --git a/data/nodes/demo.yaml b/data/nodes/demo.yaml new file mode 100644 index 0000000..e3e3592 --- /dev/null +++ b/data/nodes/demo.yaml @@ -0,0 +1,3 @@ +--- + classes: + - role::demo diff --git a/data/nodes/example-node.yaml b/data/nodes/example-node.yaml deleted file mode 100644 index ed97d53..0000000 --- a/data/nodes/example-node.yaml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/hiera.yaml b/hiera.yaml index 6230e2a..0492fbb 100644 --- a/hiera.yaml +++ b/hiera.yaml @@ -6,5 +6,7 @@ defaults: data_hash: yaml_data hierarchy: + - name: "Per-node data" + path: "nodes/%{facts.hostname}.yaml" - name: "Common defaults" path: "common.yaml" diff --git a/manifests/site.pp b/manifests/site.pp index 9b1b2f3..5574a40 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1,20 +1,2 @@ -## site.pp ## - -# This file (/etc/puppetlabs/puppet/manifests/site.pp) is the main entry point -# used when an agent connects to a master and asks for an updated configuration. -# -# Global objects like filebuckets and resource defaults should go in this file, -# as should the default node definition. (The default node can be omitted -# if you use the console and don't define any other nodes in site.pp. See -# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on -# node definitions.) - -## Active Configurations ## - -# Disable filebucket by default for all File resources: -#https://docs.puppet.com/pe/2015.3/release_notes.html#filebucket-resource-no-longer-created-by-default -File { backup => false } - -node 'demo' { - include role::demo -} +# Include all classes from (hiera)data and put them in a merged, flattened array with all duplicate values removed. +include(lookup('classes', { 'merge' => 'unique' }))