Ask Your Question

variable in hiera invisible for puppet

asked 2013-11-13 06:17:03 -0600

teebotf gravatar image


I am getting familiar with puppet. I have read manuals and now i am trying to run simple examples. Now i stuck with hiear and puppet.


   - yaml :hierarchy:
   - defaults
   - test/common
   - "%{clientcert}"
   - "%{environment}"
   - global


     :datadir: '/etc/puppetlabs/puppet/hiera/'

I have test folder within datadir


 "example" : "test string"

hiera -d example

DEBUG: 2013-11-13 14:07:45 +0200: Hiera YAML backend starting
DEBUG: 2013-11-13 14:07:45 +0200: Looking up example in YAML backend
DEBUG: 2013-11-13 14:07:45 +0200: Looking for data source defaults
DEBUG: 2013-11-13 14:07:45 +0200: Cannot find datafile ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-11-13 08:00:13 -0600

golja gravatar image


I am more guessing here, but first of all your hiera.yaml config file is doesn't look well formated. For an example check please here

Also if you are running hiera from the command line by default the config file is /etc/hiera.yaml, not in the puppet install dir.

edit flag offensive delete link more


my hiera.yaml file is default file just after installation. The only thing i did i added line - test/common and point datadir to my specific location. I did not ...(more)

teebotf gravatar imageteebotf ( 2013-11-13 09:12:25 -0600 )edit

everything works fine with class test { $val=hiera('example') notify {"Show example var: $val":} } include test But i have one more question. Here is an example of hiera.yaml hierarchy ...(more)

teebotf gravatar imageteebotf ( 2013-11-14 02:28:14 -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: 2013-11-13 06:17:03 -0600

Seen: 41 times

Last updated: Nov 13 '13