Ask Your Question

hiera not reading datadir

asked 2015-11-05 01:16:39 -0600

roguetech gravatar image

updated 2015-11-05 02:32:21 -0600

ramindk gravatar image

my /etc/puppetlabs/puppet/hiera.yaml looks like

  - yaml

  - common
  - defaults
  - "%{osfamily}"
  - "%{environment}"
  - global

  :datadir: '/etc/puppetlabs/puppet/hieradata'

but when i run hiera -d message i get

DEBUG: 2015-11-05 18:15:14 +1100: Hiera YAML backend starting
DEBUG: 2015-11-05 18:15:14 +1100: Looking up message in YAML backend
DEBUG: 2015-11-05 18:15:14 +1100: Looking for data source common
DEBUG: 2015-11-05 18:15:14 +1100: Cannot find datafile /etc/puppetlabs/puppet/environments/test/hieradata/common.yaml, skipping

it is looking in the wrong place, the second location is where it use to be but i moved it

edit retag flag offensive close merge delete


The config files are here: . Check if the config file is correct.

Cristian Falcas gravatar imageCristian Falcas ( 2015-11-05 03:37:18 -0600 )edit

i am using enterprise so it say that the /etc/puppetlabs/puppet/hiera.yaml is the conf file and that is what i am using, but as can bee seen from the output it seems like it is read from somewhere else

roguetech gravatar imageroguetech ( 2015-11-05 15:55:25 -0600 )edit

4 Answers

Sort by ยป oldest newest most voted

answered 2015-11-05 02:42:31 -0600

lupin gravatar image

hiera cli might be using different config file, try passing -c /path/hiera.yaml.

edit flag offensive delete link more


if i run hiera -d message -c /etc/puppetlabs/puppet/hiera.yaml that works but the if i run puppet agents they arent finding that

roguetech gravatar imageroguetech ( 2015-11-05 16:01:50 -0600 )edit

answered 2015-11-08 18:52:14 -0600

cm01 gravatar image

I just use the default locations myself, but I would imagine that if you change that file, it may only read it at startup, rather than dynamically, so you could try restarting the puppet server process/service.

edit flag offensive delete link more

answered 2015-11-05 18:05:04 -0600

roguetech gravatar image

So puppet is reading /etc/puppetlabs/code/hiera.yaml as its heira file but the question is why this and not the default?

edit flag offensive delete link more

answered 2015-11-05 19:00:10 -0600

lupin gravatar image

You have to symlilnk the /etc/hiera.yaml to the hiera.yaml that you wanted to use. E.g If I wanted to use the /etc/puppetlabs/code/hiera.yaml, then you can do ln -s /etc/puppetlabs/code/hiera.yaml /etc/hiera.yaml you might need to remove the /etc/hiera.yaml if that exist.

edit flag offensive delete link more


so i want it to just be the default /etc/puppetlabs/puppet/hiera i even created the ln to there in etc but still when i run hiera i get the location in /etc/puppetlabs/code/hiera.yaml

roguetech gravatar imageroguetech ( 2015-11-05 19:23:18 -0600 )edit

Did you find a solution yet? I'm having same problem. It keeps wanting to look for the default location. I have even rebooted - no dice!

Aly gravatar imageAly ( 2015-11-13 12:51:38 -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: 2015-11-05 01:16:39 -0600

Seen: 658 times

Last updated: Nov 08 '15