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.34 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.33 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.32 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.31 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.30 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.29 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.28 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.27 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.26 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.25 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.24 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.23 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.22 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.21 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.20 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.19 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.18 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.17 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.16 lib/facter/onering_properties_xen.rb
onering-report-plugins-0.0.15 lib/facter/onering_properties_xen.rb