Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 257

Custom Facts are not working with hiera on puppet agent nodes

$
0
0
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.
---
: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 .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...

Viewing all articles
Browse latest Browse all 257

Trending Articles