Here is the fact code:
Facter.add(“pbversion”) do
confine :kernel => :linux
setcode do
if File.exist? ‘/etc/pb.cfg’
Facter:Util:Resolution.exec(‘pbrun -v 2>&1 | grep -o \’Version [0-9.-]*\’ | awk \’{print $2}\’’)
else
%x{echo absent}.chomp
end
end
end