Hey there,
I'm new to hiera and I' m looking to configure it to use multiple
environments. I'm able to query hiera keys from using the hiera CLI,
however my clients seem to be having problems identifying the look up
variables.
*On the puppet master, CLI query*
[root@puppet-dev puppet]# hiera -a sshpackages environment=development
["openssh", "openssh-clients"]
*
Puppet master, testing gem load*
[root@puppet-dev puppet]# irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'hiera'
Invalid gemspec in
[/usr/lib/ruby/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date
format in specification: "2011-08-25 00:00:00.000000000Z"
=> true
*Directory structure*
[root@puppet-dev puppet]# tree /etc/puppet/environments/ -d -L 2
/etc/puppet/environments/
├── development
│ ├── hieradata
│ └── modules
└── production
├── hieradata
└── modules
*Configuration file*
[root@puppet-dev puppet]# cat /etc/hiera.yaml
---
:hierarchy:
- %{environment}
- %{operatingsystem}
- common
:backends:
- yaml
:yaml:
:datadir: '/etc/puppet/environments/%{environment}/hieradata/'
*Test manifest*
class hiera_test {
$packages = hiera('sshpackages')
notify { $packages: }
}
However, my test client errors out with the following message:
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not find data item sshpackages in any Hiera data file and no default
supplied at
/etc/puppet/environments/development/modules/hiera_test/manifests/init.pp:16
on node bakerlu-sb.missouri.edu
Anyone have words of wisdom or see anything wrong with my configuration?
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/y4jr7kHEiJ0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.