| When executing the custom fact, Facter version 4.2.x fails with the "command not found" error. Created custom facts to test the scenario as shown below.
Facter.add(:factertestingwindows) do |
confine :kernel => 'windows' |
setcode do |
Facter::Core::Execution.execute('echo Hello', :timeout => 10) |
end |
end |
It is working as expected in Facter version 3.14.x {{}}
PS C:\Users\Administrator> facter --version |
3.14.22 (commit 4d4afa91b226dfa8d2f92c495b7070377134386f) |
{{}}
PS C:\Users\Administrator> facter -p factertestingwindows |
Hello |
PS C:\Users\Administrator> |
and }}{{Not working }} {{in }}{{Facter version 4.2.x {{}}
PS C:\Users\Administrator> facter --version |
4.2.2 |
{{}}
PS C:\Users\Administrator> puppet agent -t |
Info: Using configured environment 'production' |
Info: Retrieving pluginfacts |
Info: Retrieving plugin |
Info: Loading facts |
Error: Facter: Error while resolving custom fact fact='factertestingwindows', resolution='<anonymous>': Could not execute 'echo Hello': command not found |
Info: Caching catalog for baroque-fort.delivery.puppetlabs.net |
Info: Applying configuration version 'pe-202130-master-production-67440e89804' |
Notice: Applied catalog in 0.42 seconds |
{{}} |