Ask Your Question
0

variable in hiera invisible for puppet

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

teebotf gravatar image

Hello.

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.

hiera.yaml

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

 :yaml:

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

I have test folder within datadir

common.yaml

 "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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

golja gravatar image

Hello,

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

Comments

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 -0500 )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 -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: 2013-11-13 06:17:03 -0500

Seen: 40 times

Last updated: Nov 13 '13