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.54 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.53 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.52 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.51 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.50 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.49 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.48 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.47 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.46 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.45 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.44 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.43 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.42 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.41 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.40 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.39 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.38 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.37 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.36 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.35 lib/facter/onering_properties_xen.rb