Facter 4 doesn't load yaml facts the same way that Facter 3 does. (at least on Windows.) Given a yaml file in <facterlib>/facts.d/facts.yaml like so,
---
somefact:
time: 2020-04-28 01:44:08.148119000 +00:00
Facter 3 will report that value.
PS C:\Users\Administrator> facter somefact.time
2020-04-28 01:44:08.148119000 +00:00
But Facter 4 barfs:
PS C:\Users\Administrator> facter-ng.bat somefact.time
Failed to handle C:\ProgramData/PuppetLabs/facter/facts.d/facts.yaml as LegacyFacter::Util::Parser::YamlParser
facts: Tried to load unspecified class: Time
Fact file C:\ProgramData/PuppetLabs/facter/facts.d/facts.yaml was parsed but returned an empty data set
Hi Ben Ford, thanks for reporting this bug. The problem is in the Yaml parser and it affect all OS-es
With the new fix
./bin/facter --external-dir <full_path_to_external_facts_dir> somefact.time
The fix will probably be released this week or the next on rubygems. Please give it a try from the PR branch in the meantime and let me know if there are any issues.
Tested on `Windows 2019` with the fix
$ facter-ng.bat somefact.time