Sha256: 3487729053386e4b6c0e161807d43adbb752b918b5806767996aacd47e63ce55
Contents?: true
Size: 1.02 KB
Versions: 32
Compression:
Stored size: 1.02 KB
Contents
module Specinfra class HostInventory class Virtualization < Base def get res = {} if backend.run_command('ls /.dockerinit').success? res[:system] = 'docker' return res end if backend.run_command('ls /usr/sbin/dmidecode').success? ret = backend.run_command('dmidecode') if ret.exit_status == 0 case ret.stdout when /Manufacturer: VMware/ if ret.stdout =~ /Product Name: VMware Virtual Platform/ res[:system] = 'vmware' end when /Manufacturer: Oracle Corporation/ if ret.stdout =~ /Product Name: VirtualBox/ res[:system] = 'vbox' end when /Product Name: KVM/ res[:system] = 'kvm' when /Product Name: OpenStack/ res[:system] = 'openstack' else nil end else nil end end res end end end end
Version data entries
32 entries across 32 versions & 2 rubygems