Sha256: 3cef5e45546b6c7cfc59d3633abd9c10bc27dd41d791e9bb58c3f61cae66bc7a
Contents?: true
Size: 702 Bytes
Versions: 74
Compression:
Stored size: 702 Bytes
Contents
# Onering Facts - Xen Properties # provides collection of Xen (host and guest) properties # require 'json' # get list of xen guest UUIDs xen = Facter::Util::Resolution.exec("xm list --long 2> /dev/null | grep uuid") if xen xen_uuid = [] xen.lines.each do |line| xen_uuid << line.strip.chomp.split(/[\s+\)]/).last end if not xen_uuid.empty? Facter.add('xen_guests') do setcode { xen_uuid.reject{|i| i =~ /^0{8}/ } } end end end # current xen guest: uuid if File.exists?("/sys/hypervisor/uuid") uuid = (File.read("/sys/hypervisor/uuid").strip.chomp rescue nil) if uuid and not uuid =~ /^0{8}/ Facter.add("xen_uuid") do setcode { uuid } end end end
Version data entries
74 entries across 74 versions & 2 rubygems