Ask Your Question

hiera.yaml :datadir: :hierarchy:

asked 2013-06-24 18:40:47 -0600

BaltoStar gravatar image

Puppet Agent for Windows

I have read the hiera.yaml docs but not totally understanding.

:datadir: : is this a top-level dir where hiera looks for all *.yaml config ? so typically this would be a \hiera folder somewhere in my github repo ?

:hierarchy: : need the hierarchy *.yaml be located in :datadir: ? if so, must they all be located in the same folder ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-06-25 11:22:17 -0600

GregLarkin gravatar image

Correct, :datadir: points to the directory where hiera finds your YAML files. If you don't set it explicitly, it defaults according to the platform you are using:

The hiera.yaml file specifies the :hierarchy:, and hiera.yaml does not reside in :datadir: by default. Depending on how you invoke hiera, the hiera.yaml location defaults to either COMMON_APPDATA\PuppetLabs\puppet\etc\hiera.yaml or COMMON_APPDATA\PuppetLabs\hiera\etc\hiera.yaml on Windows. Of course, you can link those files together to use the same configuration for all types of invocation.

edit flag offensive delete link more


Need all *.yaml be located at the top-level in :datadir: ? Or is it allowed to create nested sub-folders under :datadir: which puppet will recursively search for {node-name}.yaml ?

BaltoStar gravatar imageBaltoStar ( 2013-06-25 16:23:51 -0600 )edit

I don't know the answer to that, but you can experiment with it by creating a directory structure, place some YAML files in it and use the hiera command ...(more)

GregLarkin gravatar imageGregLarkin ( 2013-06-26 08:01:18 -0600 )edit

I assume COMMON_APPDATA\PuppetLabs\puppet\etc\hiera.yaml if used by puppet agent and also when invoking puppet apply from cmd, and COMMON_APPDATA\PuppetLabs\hiera\etc\hiera.yaml is used ...(more)

BaltoStar gravatar imageBaltoStar ( 2013-06-27 06:20:49 -0600 )edit

That is a Windows-specific question, and I'm afraid I'm no help there. If you were running on a UNIX system, a symbolic link (ln -s) would do the trick.

GregLarkin gravatar imageGregLarkin ( 2013-06-27 16:06:50 -0600 )edit

FYI, please mark answers as correct (here and elsewhere) if the original question has been answered to your satisfaction. This will help promote continued assistance from all of the community members.

GregLarkin gravatar imageGregLarkin ( 2013-06-27 16:08:33 -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-06-24 18:40:47 -0600

Seen: 951 times

Last updated: Jun 25 '13