Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out Puppet (3.0) and how it relates to built-in Hiera. So this is what I tried, an extremely simple example (I'll make a more complex hierarchy when I manage to get the simple one working):

# /etc/puppet/hiera.yaml
  - yaml
  - common
  :datadir: /etc/puppet/hieradata

# /etc/puppet/hieradata/common.yaml
test::param: value

# /etc/puppet/modules/test/manifests/init.pp
class test ($param) { notice($param) }

# /etc/puppet/manifests/site.pp
include test

If I directly apply it, it's fine:

$ puppet apply /etc/puppet/manifests/site.pp
Scope(Class[Test]): value

If I go through puppet master, it's not fine:

$ puppet agent --test
Could not retrieve catalog from remote server: Error 400 on SERVER: Must pass param to Class[Test] at /etc/puppet/manifests/site.pp:1 on node <nodename>

What am I missing?


I just left the office but a thought struck me: I should probably restart puppet master so it can see the new hiera.conf. I'll try that on Monday; in the meantime, if anyone figures out some not-it problem, I'd appreciate it :)

share|improve this question
Good review of the implicit lookup in Kelsey's talk from Puppet conf 2012: (at 38mns) - however, I had some issues with this feature: – robbyt Nov 10 '12 at 19:06
up vote 1 down vote accepted

I am an idiot, and the edit in the question was correct: after restarting puppet master, everything worked fine.

share|improve this answer

For Hiera ( /etc/puppet/environments/local/hieradata/hostgroups/base/yourhostname/all.yaml )

mySuperVariable: lalala

For Init ( /etc/puppet/environments/local/manifests/yourhostname/manifest )

class mimir::init { $myvariable = hiera('mySuperVariable', 'fallbackValue') }

For Template ( /etc/puppet/environments/local/manifests/yourhostname/templates )

whatever ... <%= myvariable%> blahblah

share|improve this answer
If it wasn't clear, I was trying to figure out the implicit lookup, without using the hiera function. Also, the title explicitly mentions classes, and implicitly modules. – Amadan Nov 10 '12 at 6:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.