libvirt_uuid.rb 209 B

123456789101112
  1. require 'facter'
  2. Facter.add(:libvirt_uuid) do
  3. setcode do
  4. uuid_file_path = '/etc/libvirt/libvirt_uuid'
  5. if File.file? uuid_file_path
  6. File.read uuid_file_path
  7. else
  8. nil
  9. end
  10. end
  11. end