Ask Your Question

Trouble with facts/hiera after puppet upgrade

asked 2017-06-13 08:46:16 -0600

tobowers gravatar image


I'm attempting to upgrade puppet 3.8 -> 4.10 (just on vagrant right now). I'm having trouble getting my hiera paths to resolve.


myfact: engineering


version: 5
hierarchy: # Most specific to least specific
  - name: "Yaml lists"
    datadir: /etc/puppetlabs/code/environments/%{::environment}/hieradata
    data_hash: yaml_data
      - nodes/%{facts.myfact}.yaml


puppet lookup --facts /vagrant/facts.yaml --hiera_config=/vagrant/modules/puppet/files/hiera.yaml --merge deep --environment some_environment --explain --compile classes

Searching for "classes"
  Global Data Provider (hiera configuration version 5)
    Using configuration "/vagrant/modules/puppet/files/hiera.yaml"
    Hierarchy entry "Yaml lists"
      Path "/etc/puppetlabs/code/environments/some_environment/hieradata/nodes/.yaml"
        Original path: "nodes/%{facts.myfact}.yaml"
        Path not found
Function lookup() did not find a value for the name 'classes


Notice how the path didn't fillin "myfact" at all. I've also tried where "myfact" is a symbol in the fact.yaml and I'm getting the same result. This behavior is also happening in puppet apply (which was working before upgrade). You'll notice that %{::environment} is working correctly though.

edit retag flag offensive close merge delete


I actually got it to work by using FACTER_myfact environment variable but the facts.yaml is still not working

tobowers gravatar imagetobowers ( 2017-06-14 01:38:45 -0600 )edit

dara_dir and data_bash should not be part of hierarchy. Can you please move them to defaults as mentioned in the doc and test again?

Mr_Sharma gravatar imageMr_Sharma ( 2017-06-14 02:37:39 -0600 )edit

That's not what the docs say... that's only if there *is* a default (in my case there actually isn't). Also, this works with an environment variable but not the facts.yaml.

tobowers gravatar imagetobowers ( 2017-06-14 03:23:58 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-06-14 00:59:50 -0600

Mr_Sharma gravatar image

It seems there's problem while converting your older hiera.yaml to version 5, particularly while defining backend and datadir. Can you please follow the steps here and check if it works?

edit flag offensive delete link more


Do you see a problem in the hiera.yaml I posted?

tobowers gravatar imagetobowers ( 2017-06-14 01:38:17 -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: 2017-06-13 08:46:16 -0600

Seen: 154 times

Last updated: Jun 14 '17