Exporting custom fact to PuppetDB ok with command but KO with daemon

22 views
Skip to first unread message

Vincent Miszczak

unread,
Nov 27, 2014, 8:28:07 AM11/27/14
to puppet...@googlegroups.com
Hello,

Nearly everything is in the title.

When I manually run a puppet agent --test on a host (let's say "host1") that export @@something, I can get "something" on another host (let's say host2) and I'm happy.

Later, when the daemon on host1 runs, it still exports @@something but custom facts are empty instead of having their value.

What am I missing ?

Wil Cooley

unread,
Nov 28, 2014, 11:36:20 AM11/28/14
to puppet-users group

"Have you tried turning it off and on again?"

Seriously, have you tried restarting the agent daemon?

This happens sometimes when Facter itself is updated and if you've gone through several iterations of your custom fact, it may well apply here. When the agent runs as a daemon, it does not completely reinitialize, so it is possible that updated code could not get reloaded.

Wil

Ken Barber

unread,
Nov 28, 2014, 11:43:41 AM11/28/14
to Puppet Users
Do you mean your custom facts don't appear in your manifest code? Or
in PuppetDB?

Sometimes this could indicate a misconfigured routes.yaml. It should
look something like this:

root@puppetdb1:~# cat /etc/puppet/routes.yaml
---
master:
facts:
terminus: puppetdb
cache: yaml

This file belongs on your puppet master host, that is configured to
connect to PuppetDB. If you change it, your puppet master requires a
restart.

Without this configuration, you may find PuppetDB is being used for
facts instead of using the received facts from an agent. That is, it
might get populated the first time, but subsequent runs will only
retrieve facts from the first run from PuppetDB and only those will
appear in your manifest scope.

ken.
Reply all
Reply to author
Forward
0 new messages