Skip to content

Specifying --node on puppet lookup always fails with No facts available for target node #9544

Closed
@J-Verz

Description

@J-Verz

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

  1. 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
  1. Create a hieradata/common.yaml like so:
foo: common
  1. Create a node-specific file hieradata/nodes/node.example.com.yaml like so:
foo: node
  1. Run puppet lookup foo --node node.example.com
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions