Ask Your Question

Revision history [back]

Trouble with facts/hiera after puppet upgrade


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.