Skip to content

Instantly share code, notes, and snippets.

@kpaulisse
Created February 17, 2017 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kpaulisse/b8a8f854988032eceae3e53f242d6309 to your computer and use it in GitHub Desktop.
Save kpaulisse/b8a8f854988032eceae3e53f242d6309 to your computer and use it in GitHub Desktop.
#hieradata/ldap/groups.yaml
---
top:
middle:
groups:
foo:
gid: 500
---
:backends:
- yaml
:yaml:
:datadir: /etc/puppetlabs/code/environments/%{::environment}/hieradata
:hierarchy:
- ldap/users
- ldap/groups
- common
:merge_behavior: deeper
:logger: console
-------------
WORKING
-------------
#ii puppet-agent 1.8.3-1jessie amd64 The Puppet Agent package contains all of the elements needed to run puppet, including ruby, facter, hiera and mcollective.
#ii puppetserver 2.7.2-1puppetlabs1 all Puppet Labs puppetserver
Notice: /Stage[main]/Main/Node[default]/Notify[{
"middle": {
"groups": {
"foo": {
"gid": 500
}
},
"users": {
"kevin": {
"uid": 500
}
}
}
}]/message: current_value absent, should be {
"middle": {
"groups": {
"foo": {
"gid": 500
}
},
"users": {
"kevin": {
"uid": 500
}
}
}
} (noop)
-------------
NOT WORKING
-------------
#ii puppet-agent 1.9.1-1jessie amd64 The Puppet Agent package contains all of the elements needed to run puppet, including ruby, facter, hiera and mcollective.
#ii puppetserver 2.7.2-1puppetlabs1 all Puppet Labs puppetserver
Notice: /Stage[main]/Main/Node[default]/Notify[{
"middle": {
"users": {
"kevin": {
"uid": 500
}
}
}
}]/message: current_value absent, should be {
"middle": {
"users": {
"kevin": {
"uid": 500
}
}
}
} (noop)
#manifests/site.pp
node default {
$hiera_data = hiera_hash('top')
notify { inline_template("<%= JSON.pretty_generate(@hiera_data) %>"): }
}
#hieradata/ldap/users.yaml
---
top:
middle:
users:
kevin:
uid: 500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment