Ask Your Question

how can i access fact hashes in hiera hierarchies

asked 2016-01-07 09:20:48 -0600

relativemedia gravatar image

using puppet open source 3.8.4, hiera 1.3.4 and I am trying to figure out how to access a custom structured data fact to build out my hiera yaml hierarchy.

when i run puppet in debug mode it doesn't find the component hierarchy, it just finds environment/common and common.

As soon as i switch the fact from a hash to basic individual string variables and update the hierarchy to be %{::component} it finds the path.

At what version did hiera support hashed facts in its config file, or am i missing something. note I have tried various different syntaxes of ::sapenvs:component i.e; ::sapenvs[component], ::sapenvs.component.


  component: 'ECC'


  - yaml
  :datadir: /opt/puppet/hieradata
  - "%{::environment}/%{::sapenvs:component}/common"
  - "%{::environment}/common"
  - "common"
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-02-07 19:27:18 -0600

Henrik Lindberg gravatar image

Since Hiera 2.0.0 you can work with structured facts. Here is the documentation:

edit flag offensive delete link more


Is there any way to work with these in Hiera 1.3?

otheus gravatar imageotheus ( 2017-02-15 12:45:48 -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: 2016-01-07 09:20:48 -0600

Seen: 1,234 times

Last updated: Jan 07 '16