Look all good to me:
puppet@puppet:/etc/puppetlabs/puppet$ ls -ltr total 40 -rw-r--r--. 1 puppet puppet 5487 Sep 23 22:22 auth.conf -rw-r--r--. 1 puppet puppet 657 Sep 24 12:17 puppet.conf drwxrwx--x. 1 puppet puppet 4096 Sep 27 16:22 ssl drwxr-x---. 2 puppet puppet 4096 Sep 27 22:32 devices -rw-r--r--. 1 puppet puppet 219 Feb 26 13:43 hiera.yaml *puppet@puppet:/etc/puppetlabs/puppet$* more hiera.yaml --- # Hiera 5 Global configuration file version: 5 #defaults: #data_hash: yaml_data # datadir: /etc/puppetlabs/code/environments/production/data # hierarchy: # - name: Common # data_hash: yaml_data #hierarchy: [] *puppet@puppet:/etc/puppetlabs/code/environments/production$* ls -ltr total 16 drwxr-xr-x. 6 root root 4096 Oct 22 14:06 modules drwxr-xr-x. 2 root root 4096 Feb 18 16:04 manifests -rw-r--r--. 1 root root 618 Feb 26 12:40 hiera.yaml drwxr-xr-x. 3 root root 4096 Feb 26 13:07 data *puppet@puppet:/etc/puppetlabs/code/environments/production$* more hiera.yaml --- version: 5 defaults: # The default value for "datadir" is "data" under the same directory as the hiera.yaml # file (this file) # When specifying a datadir, make sure the directory exists. # See https://puppet.com/docs/puppet/latest/environments_about.html for further details on environments. #datadir: data data_hash: yaml_data hierarchy: - name: "Per-node data" # Human-readable name. path: "nodes/%{trusted.certname}.yaml" # File path, relative to datadir. - name: "Per-OS defaults" path: "os/%{facts.os.family}.yaml" - name: "Common data" path: "common.yaml" *puppet@puppet:/etc/puppetlabs/code/environments/production/data/nodes$* ls -ltr total 8 -rw-r--r--. 1 root root 31 Feb 25 15:42 nodename.domain.com.yaml *puppet@puppet:/etc/puppetlabs/code/environments/production/data/nodes$* more nodename.domain.com.yaml --- sshdconfig::match_address: "xx.xx.xx.xx" sshdconfig::permit_root_login: without-password Some files above are onwned by root however, have sufficient permissions to be at least read. On Wednesday, February 26, 2020 at 1:27:22 PM UTC, Henrik Lindberg wrote: > > On 2020-02-25 16:51, Dan Crisp wrote: > > This is what I have: > > > > --- > > sshdconfig: > > match_address: "xx.xx.xx.xx" > > permit_root_login: without-password > > > > YAML Lint validates the YAML ok. > > > > However, it doesn't matter what I put in this file (Non YAML or a bunch > > of random characters ) the result is the same so I suspect it's not > > being read. How can I confirm that the file is actualy being read > > rather than simply sucessfully displayed in the lookup output. > > Check permissions on files, it may be silently skipping files that > cannot be read. > - henrik > > > > > On Tuesday, February 25, 2020 at 12:58:02 PM UTC, Henrik Lindberg wrote: > > > > 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> > > <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/> > > > <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...@googlegroups.com <javascript:> > > > <mailto:puppet-users+unsubscr...@googlegroups.com <javascript:> > <javascript:>>. > > > 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> > > > > > > > > > < > https://groups.google.com/d/msgid/puppet-users/51b5a4bd-0e18-42c9-8cc3-9b77bcfd4218%40googlegroups.com?utm_medium=email&utm_source=footer > > > < > 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/ > > <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...@googlegroups.com <javascript:> > > <mailto:puppet-users+unsubscr...@googlegroups.com <javascript:>>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/puppet-users/25c608f0-78db-4b67-b563-de872b7a2d36%40googlegroups.com > > > < > https://groups.google.com/d/msgid/puppet-users/25c608f0-78db-4b67-b563-de872b7a2d36%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/cd9e89f3-b95d-4855-baa1-d16db3bd42fc%40googlegroups.com.