I know that the following custom fact matches the string I want, as if I add a 'puts' or 'print' ahead of the $1 it prints the correct string. But as show the fact returns nothing. A blank.
Facter.add(:myhost) do
confine :kernel => "Linux"
setcode do
fh = File.open('/etc/enc_params.conf')
fh.each_line do |line|
if line =~ /\Amyhost.*\s(\w+)\Z/
$1
end
end
end
end
For the record!
end