Ask Your Question
1

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

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

cweiske gravatar image

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

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
0

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

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
/private/etc/hiera.yaml
$ cp /private/etc/hiera.yaml /Users/stefan/.puppet/

$ puppet --version
3.8.3
$ hiera --version
1.3.4
$ cat ~/.puppet/hiera.yaml 
---
:backends:
  - yaml
:hierarchy:
  - defaults
  - "%{clientcert}"
  - "%{environment}"
  - global

:yaml:
# 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.
  :datadir:
$
edit flag offensive delete link more
0

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

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

Comments

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

Have a look here: https://docs.puppetlabs.com/hiera/1/configuring.html#default-config-values

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

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

Seen: 2,193 times

Last updated: Oct 06 '15