sure, ```# This file can be used to override the d...
# puppet
m
sure,
Copy code
# This file can be used to override the default puppet settings.
# See the following links for more details on what settings are available:
# - https://puppet.com/docs/puppet/latest/config_important_settings.html
# - https://puppet.com/docs/puppet/latest/config_about_settings.html
# - https://puppet.com/docs/puppet/latest/config_file_main.html
# - https://puppet.com/docs/puppet/latest/configuration.html
[server]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
default_manifest       = ./manifests/site.pp
#default_manifest       = ./current/manifests/site.pp
factpath               = $vardir/lib/facter
templatedir            = $confdir/templates
#environmentpath       = $confdir/environments
basemodulepath         = $confdir/modules:/usr/share/puppet/modules/
# disable caching environments
environment_timeout    = 0
# disable CA cert auto-signing, we do this manually for now
autosign               = false
tagmap                  = $confdir/tagmail.conf
reports                = store,puppetdb,tagmail

[main]
codedir                = /data/puppet-modules
#external_nodes        = /etc/puppet/foreman_enc.rb --no-environment
#node_terminus         = exec
environment            = production
environments           = production
environmentpath        = /data/puppet-modules/environments
#modulepath             = $environmentpath/$environment/current/modules:$basemodulepath
dns_alt_names          = puppet,puppet.example.at,at-example-puppet-server1,at-example-puppet-server1,at-example-puppet-server1.example.at
#ssl_client_header        = SSL_CLIENT_S_DN
#ssl_client_verify_header = SSL_CLIENT_VERIFY
#address="::"
storeconfigs           = true
storeconfigs_backend   = puppetdb
reports                = store,puppetdb
#reports               = store,puppetdb,foreman
# we want to have the $facts variable available
stringify_facts        = false
trusted_node_data      = true
immutable_node_data    = true


[agent]
server            = puppet.example.at
masterport        = 8140
report            = true
splay             = true
runinterval       = 3600
syslogfacility    = local3
usecacheonfailure = false
c
What do you have in
/etc/puppetlabs/puppet/routes.yaml
? Your
puppet facts show --debug
shows that
puppet facts
is deciding to query PuppetDB instead of loading Facter up and getting fresh data. So, that
"facterversion": "4.2.4"
result is likely some stale data coming out of PupetDB, especially given
find /
didn't turn up another facter gem lurking anywhere on the system.
🤨 1
m
I don't have a
/etc/puppetlabs/puppet/routes.yaml
can confirm that the facts for that node are stale in PuppetDB, including that facterversion fact
hi @csharpsteen, do you have any idea how to change this behavior please?
c
The problem appears to be that when you run
puppet facts show
on this node, it sets up to query historical data from PuppetDB:
Copy code
# /opt/puppetlabs/bin/puppet facts show puppetversion facterversion --debug
Debug: Runtime environment: puppet_version=7.34.0, ruby_version=2.7.8, run_mode=user, openssl_version='OpenSSL 1.1.1w  11 Sep 2023', openssl_fips=false, default_encoding=UTF-8
Debug: Configuring PuppetDB terminuses with config file /etc/puppetlabs/puppet/puppetdb.conf

...
When I run
puppet facts show
on a Debian 12 node with
puppet-agent
7.34.0,
puppetserver
, and
puppetdb
installed, it loads up facter and generates fresh data from the system:
Copy code
# /opt/puppetlabs/bin/puppet facts show puppetversion facterversion --debug
Debug: Runtime environment: puppet_version=7.34.0, ruby_version=2.7.8, run_mode=user, openssl_version='OpenSSL 1.1.1w  11 Sep 2023', openssl_fips=false, default_encoding=UTF-8
Debug: Loading external facts from /opt/puppetlabs/puppet/cache/facts.d
Info: Loading facts
...
The only things I know of that can affect where
puppet
loads facts from are the
facts_terminus
setting in
puppet.conf
and the
routes.yaml
file. Both of those appear to be absent on your installation. So, there is some uncommon configuration that has been applied to your node that is resulting in the use of PuppetDB instead of Facter.
m
Thanks... in the meantime I've found something very interesting: this is actually the same problem as described here: https://www.reddit.com/r/Puppet/comments/jn0v7p/puppet_facts_gives_nearly_empty_output/ I also have a different output (fresh when using underprivileged user and stale when using root). A solution was never found either there. Will probably check if the env is in any way different between the two and end up reinstalling if this is not going anywhere...