We have created a custom factor "datacenter" via /lib/facter/datacenter.rb on puppet master node. when i ran facter -p datacenter, it works fine, and so added the same in hiera.yaml..yaml, but when we ran the same "puppet agent -t" on agent nodes, it fails, with the error " could not find data item in any of the hiera file"
Can someone please help to debug this...
---
:backends:
- yaml
:hierarchy:
- "nodes/%{::trusted.certname}"
- "%{::datacenter}"
- "%{::osfamily}"
- common
:yaml:
# datadir is empty here, so hiera uses its defaults:
# - /etc/puppetlabs/code/environments/%{environment}/hieradata on *nix
# - %CommonAppData%\PuppetLabs\code\environments\%{environment}\hieradata on Windows
# When specifying a datadir, make sure the directory exists.
:datadir:
When i ran "puppet agent -t" on puppet master it runs fine.. and picked the hiera parameter value from