I'm setting up Hiera in my multi-environment puppetmaster for the first
time.
I've written /etc/puppet/hiera.yaml, defined the hierarchies and created
a couple of data files with sample data in them. When queried from the
commandline, it works:
[jg4461@puppet ~]$ hiera -d -c /etc/puppet/hiera.yaml motd::banner
environment=netops_jg4461
DEBUG: Mon Mar 04 11:42:29 +0000 2013: Hiera YAML backend starting
DEBUG: Mon Mar 04 11:42:29 +0000 2013: Looking up motd::banner in YAML
backend
DEBUG: Mon Mar 04 11:42:29 +0000 2013: Looking for data source netops_jg4461
DEBUG: Mon Mar 04 11:42:29 +0000 2013: Found motd::banner in netops_jg4461
MOTD BANNER for NETOPS
However, when I try to reference this variable in a manifest with syntax
like this:
class motd {
file { 'motd':
name => '/etc/motd',
mode => '0644',
owner => 'root',
group => 'root',
content => hiera('motd::banner'),
}
}
It fails with this error:
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: Could not find data item motd::banner in any Hiera data file and
no default supplied at
/home/jg4461/PUPPETROOT/environments/common/modules/motd/manifests/init.pp:7
on node ******.bris.ac.uk
My hiera.yaml points to the right location (the puppet dev environment
is being served from my homedir on the puppetmaster but all hiera data
is stored in /etc/puppet/hiera, with the production puppet environment).
What kind of things should I be looking for here?
Thanks,
Jonathan
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.