Puppet8 'lookup' fails when Puppet7 succeeds

326 views
Skip to first unread message

Jon Jaroker

unread,
Aug 23, 2023, 12:30:33 PM8/23/23
to Puppet Users
I am migrating from puppet 7 to puppet 8 by first updating servers in a staging environment (which is operating puppet version 8.1.0).  While debugging hiera, I notice the following unusual behavior with the puppet lookup command.

In the production environment running puppet 7.25.0, the following two commands produce the same correct output:

[1] puppet lookup sshd::config --environment production --node 'puppet.datacenter' --explain --verbose --hiera_config=/etc/puppetlabs/code/environments/production/hiera.yaml

[2] puppet lookup sshd::config --environment production  --explain --verbose --hiera_config=/etc/puppetlabs/code/environments/production/hiera.yaml

Both commands are run on the puppet master.  Command [2] omits the --node option.  Both commands produce the correct lookup.

In the staging environment that was generated by branching production->staging, a newly-created puppet master fails when the -node option is specified.  Specifically,

[3] puppet lookup sshd::config --environment staging --node 'puppet.staging' --explain --verbose --hiera_conf
ig=/etc/puppetlabs/code/environments/staging/hiera.yaml
Error: Could not run: No facts available for target node: puppet.staging

but the following command (which omits the -node option) produces the correct lookup

[4]puppet lookup sshd::config --environment staging --explain --verbose --hiera_config=/etc/puppetlabs/code/
environments/staging/hiera.yaml

There are no warnings or other debug messages.  The structure of the data directory and manifests is exactly the same.  The production environment has puppetDB operating, but the staging environment was newly created and only has puppetserver.

Any suggestions on how to debug this would be appreciated.

Thank you,
Jon

Martin Alfke

unread,
Aug 24, 2023, 3:44:58 AM8/24/23
to puppet...@googlegroups.com
Hi Jon,

Do you have a node named “puppet.staging” running against you puppet staging environment?
The —node option reads nodes facts from PuppetDB.
That means that you must have anode connected to the puppet server where sou want to run the puppet lookup command.

Hth,
Martin


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/a4c86230-3d8c-4711-a4b6-7a3db676b625n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages