Hi chaps, thanks for your responses.

Running puppetmaster in debug mode fixed the problem, as a side effect. I hadn't appreciated that after editing /etc/puppet/hiera.yaml puppetmaster needs to be restarted - I thought that file would be read each time hiera grabs a variable.

TL;DR: I turned it off and on again ;)

Cheers,
Jonathan


On 05/03/13 07:34, Denmat wrote:
Hi,

You can run the master in debug mode and it will show you where puppet is 
looking for the hiera files.

Give it a whirl,
Den

On 04/03/2013, at 22:49, Jonathan Gazeley <jonathan.gaze...@bristol.ac.uk> 
wrote:

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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to