For facter/puppet, I installed a one-line shell script. Several, actually. On subsequent runs, and with facter -p, I see the following output:

Fact file /etc/facter/facts.d/system_facts_<factname>.sh was parsed but returned an empty data set

If I run the script manually from the command-line, I get the expected output. If I use facter -p <factname> I get the empty string.

Puppet version: 3.8.2

Note: not a duplicate of Facter - custom fact, returns empty data set when invoked by Puppet agent


The official documentation helped me realize the script must produce output in the form of key=value. Thus, a single script can generate many different sets of information. (Now I realize why facter is so damn slow.) But if it produces output in just the form of value, facter doesn't know what to do with it.

  • Yes, but how does this relate to Facter's performance? Just being curious about your reasoning here. – Felix Frank Aug 21 '15 at 13:33
  • 1
    Because it cannot assume that file X is associated with fact Z, it must search through all possible facter files before it can report on any of them. The end-result is a a lot of file touches. My strace indicated it was opening each possible fact file 3 times. I also see how facter may have architecturally built in sluggishness to their design -- by allowing facts to be declared multiple times, each with different "weights", it might be impossible to cache the data. – Otheus Aug 21 '15 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.