Ask Your Question

/etc/puppet/hiera.yaml not found, using Hiera defaults

asked 2015-07-20 00:48:21 -0600

cweiske gravatar image

updated 2015-10-06 18:21:44 -0600

When applying my puppet config file, I always get the following red warning:

Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults

How can I get rid of it?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-10-06 18:21:15 -0600

Yes this is frustrating, because you would think it would work out of the box on a freshly installed system.

This has happened to me several times. Each time, I simply worked around the problem by copying the data from another location.

First, was a RHEL6 box. /etc/hiera.yaml existed, /etc/puppet/hiera.yaml did not, so I simply did:

ln -s /etc/hiera.yaml /etc/puppet/hiera.yaml

The second time was on my Mac:

$ puppet apply --test ./myclass.pp 
Warning: Config file /Users/stefan/.puppet/hiera.yaml not found, using Hiera defaults

In this case, I found a defaults file and copied it to ~/.puppet:

$ locate hiera.yaml
$ cp /private/etc/hiera.yaml /Users/stefan/.puppet/

$ puppet --version
$ hiera --version
$ cat ~/.puppet/hiera.yaml 
  - yaml
  - defaults
  - "%{clientcert}"
  - "%{environment}"
  - global

# datadir is empty here, so hiera uses its defaults:
# - /var/lib/hiera on *nix
# - %CommonAppData%\PuppetLabs\hiera\var on Windows
# When specifying a datadir, make sure the directory exists.
edit flag offensive delete link more

answered 2015-07-22 08:54:00 -0600

something in module(s) trying to use hiera? maybe create a stub hiera.yaml file:

:backends: - yaml

:logger: console

:hierarchy: - "%{operatingsystem}" - common

:yaml: :datadir: /etc/puppet/hieradata

edit flag offensive delete link more


But what if the defaults change one day? Can I get the default file from somewhere?

cweiske gravatar imagecweiske ( 2015-07-24 03:15:35 -0600 )edit

Have a look here:

:backends: yaml
  :datadir: /var/lib/hiera
:hierarchy: common
:logger: console

stumped gravatar imagestumped ( 2015-11-03 16:19:36 -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-07-20 00:48:21 -0600

Seen: 3,303 times

Last updated: Oct 06 '15