Facter: Custom-fact-script “was parsed but returned an empty data set”

facterpuppet

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

Best Answer

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.