Ask Your Question

Hiera - module_name not found

asked 2014-02-18 13:49:26 -0600

ok_delta gravatar image

updated 2014-02-18 13:54:11 -0600

I have got the following Problem. [Puppetmaster 3.4.2; Passenger; Puppet Agent 3.4.2]

I would like to have specific Hiera yaml files for every module in my different environments. I have created the hierarchy accordingly but do not seem to get it working. defined variables are not found though to module_name

hierarchy line: - "environments/%{::environment}/modules/%{::module_name}"

I have already done the following

  • Try callingmodule, callingclass
  • Without ::
  • Automatic Parameter Lookup and explicit class definition with hiera function
  • Static testing - yaml works fine, environment is working, only module_name is my problem

I have tested with the ... (more)

edit retag flag offensive close merge delete


Please post the actual errors that Puppet is printing.

Ancillas gravatar imageAncillas ( 2014-02-18 15:26:53 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-02-18 15:21:37 -0600

Ancillas gravatar image

updated 2014-02-18 15:25:43 -0600

I just tested this on Puppet 3.3.2 and 3.4.2 and confirmed that the following setup worked in both. Please forgive my self-indulgent variable naming :).


  - yaml
  - "environments/%{environment}/modules/%{module_name}"
  - common

  :datadir: "/etc/hiera"

greg_test module init.pp

class greg_test(
  $arbitrary_value = hiera('greg')
) {
  notify {"${arbitrary_value}": }


greg: 'awesome'


include greg_test

I'm kicking off my puppet run with sudo puppet apply --modulepath=/etc/puppet/modules /tmp/run.pp and got this output.

Notice: Compiled catalog for in environment production in ...
edit flag offensive delete link more


Thx - I removed my hierarchy line and replaced it with yours. Works fine now, thanks!

ok_delta gravatar imageok_delta ( 2014-02-19 09:38:22 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-02-18 13:49:26 -0600

Seen: 552 times

Last updated: Feb 18 '14