On 2020-02-25 13:42, Dan Crisp wrote:
I included the --compile option.  Now (not sure whether as a result of use --option) I can see/etc/puppetlabs/code/environments/production/data/nodes/nodename.domain.com.yaml in the output:


Probably because you got a run done by the agent?
Anyway - first step, make sure you see the expected paths being read.
Then, for the file where you expect the key to be found and produce a value, do check the content of that file - is it valid yaml, is it representing what you think it represents?

best,
- henrik


Searching for "lookup_options"
   Global Data Provider (hiera configuration version 5)
     No such key: "lookup_options"
   Environment Data Provider (hiera configuration version 5)
    Using configuration "/etc/puppetlabs/code/environments/production/hiera.yaml"
     Merge strategy hash
       Hierarchy entry "Per-node data"
        Path "/etc/puppetlabs/code/environments/production/data/nodes/nodename.fixnetix.com.yaml"
           Original path: "nodes/%{trusted.certname}.yaml"
           No such key: "lookup_options"
       Hierarchy entry "Per-OS defaults"
        Path "/etc/puppetlabs/code/environments/production/data/os/RedHat.yaml"
           Original path: "os/%{facts.os.family}.yaml"
           Path not found
       Hierarchy entry "Common data"
        Path "/etc/puppetlabs/code/environments/production/data/common.yaml"
           Original path: "common.yaml"
           Path not found
Searching for "match_address"
   Global Data Provider (hiera configuration version 5)
     No such key: "match_address"
   Environment Data Provider (hiera configuration version 5)
    Using configuration "/etc/puppetlabs/code/environments/production/hiera.yaml"
     Hierarchy entry "Per-node data"
      Path "/etc/puppetlabs/code/environments/production/data/nodes/lhcsrvmtrrsl01.fixnetix.com.yaml"
         Original path: "nodes/%{trusted.certname}.yaml"
         No such key: "match_address"
     Hierarchy entry "Per-OS defaults"
      Path "/etc/puppetlabs/code/environments/production/data/os/RedHat.yaml"
         Original path: "os/%{facts.os.family}.yaml"
         Path not found
     Hierarchy entry "Common data"
       Path "/etc/puppetlabs/code/environments/production/data/common.yaml"
         Original path: "common.yaml"
         Path not found
Function lookup() did not find a value for the name 'match_address'

Still no luck finding the requested value though.

Thanks,
Dan.

On Monday, February 24, 2020 at 7:13:25 PM UTC, Henrik Lindberg wrote:

    Dan Crisp wrote:
     >  environment/production/data/nodes/nodename.domain.com.yaml
    As you can see in the output - the hiera path expanded to:

        Path
    "/etc/puppetlabs/code/environments/production/data/nodes/.yaml"

    Meaning that trusted.certname was empty. It would be empty if the node
    "nodename.domain.com <http://nodename.domain.com>" never checked in
    with the puppet server to deposit
    any facts. It will do that on its first agent run though.

    Meanwhile you have to supply your own facts (and trusted) to do lookups
    as it will be done when the node later requests a catalog. Look at the
    help for the various flags to the lookup command to learn how to
    give it
    values for facts and trusted information.

    - henrik


--
    Visit my Blog "Puppet on the Edge"
    http://puppet-on-the-edge.blogspot.se/
    <http://puppet-on-the-edge.blogspot.se/>

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com <mailto:puppet-users+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/51b5a4bd-0e18-42c9-8cc3-9b77bcfd4218%40googlegroups.com <https://groups.google.com/d/msgid/puppet-users/51b5a4bd-0e18-42c9-8cc3-9b77bcfd4218%40googlegroups.com?utm_medium=email&utm_source=footer>.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/r335k6%24c2e%241%40ciao.gmane.io.

Reply via email to