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

Version Path
onering-report-0.6.13 lib/facter/onering_properties_xen.rb
onering-report-0.6.12 lib/facter/onering_properties_xen.rb
onering-report-0.6.11 lib/facter/onering_properties_xen.rb
onering-report-0.6.10 lib/facter/onering_properties_xen.rb
onering-report-0.6.9 lib/facter/onering_properties_xen.rb
onering-report-0.6.8 lib/facter/onering_properties_xen.rb
onering-report-0.6.7 lib/facter/onering_properties_xen.rb
onering-report-0.6.6 lib/facter/onering_properties_xen.rb
onering-report-0.6.5 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.65 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.64 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.63 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.62 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.61 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.60 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.59 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.58 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.57 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.56 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.55 lib/facter/onering_properties_xen.rb