Ask Your Question
0

Hiera - module_name not found

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

ok_delta gravatar image

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

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

Comments

Please post the actual errors that Puppet is printing.

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

1 Answer

Sort by ยป oldest newest most voted
1

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

Ancillas gravatar image

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

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 :).

hiera.yaml

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

:yaml:
  :datadir: "/etc/hiera"

greg_test module init.pp

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

/etc/hiera/environments/production/modules/greg_test.yaml

---
greg: 'awesome'

/tmp/run.pp

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 mynode.mydomain.com in environment production in ...
(more)
edit flag offensive delete link more

Comments

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 -0500 )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

Stats

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

Seen: 443 times

Last updated: Feb 18 '14