Custom fact is always empty
I have the following Ruby file (medialibraryhost.rb) in my module's lib/facter directory:
Facter.add(:media_library_host) do confine :kernel => :linux setcode do Facter::Util::Resolution.exec('if [ -e "/etc/medialibrary.host" ] ; then cat /etc/medialibrary.host ; fi') end end
Basically it reads host line from a file. But no matter what I put in that file whenever I try to use
$::media_library_host fact in my manifests it is empty. Any clues?