Closed
Description
Describe the Bug
When trying to lookup Hiera data using puppet lookup foo --node node.example.com
, I always get No facts available for target node: node.example.com
. This even happens if I enter the hostname of the node I am on. If I leave off the --node
option I get results for the current node like expected.
Expected Behavior
I should be able to lookup node-specific Hiera data by specifying the node with --node
Steps to Reproduce
- Create a
hiera.yaml
like so
version: 5
defaults:
datadir: hieradata
data_hash: yaml_data
hierarchy:
- name: Per-node data
path: "nodes/%{trusted.certname}.yaml"
- name: Common data
path: common.yaml
- Create a
hieradata/common.yaml
like so:
foo: common
- Create a node-specific file
hieradata/nodes/node.example.com.yaml
like so:
foo: node
- Run
puppet lookup foo --node node.example.com
- Get
Error: Could not run: No facts available for target node: node.example.com
as result
Environment
- Puppet Version: 7.23.0
- Puppetserver Version: 7.9.5
- Platform: Debian 12