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-plugins-0.0.14 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.13 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.12 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.11 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.10 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.9 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.8 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.7 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.6 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.5 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.4 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.3 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.2 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.1 lib/facter/onering_properties_xen.rb