Sha256: c1ae971172ed3bba56fba7a9dcae8391c7bbb91a25cc345f66a14042c1f4c665
Contents?: true
Size: 1.02 KB
Versions: 54
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true module Facts module Linux module Hypervisors class Vmware FACT_NAME = 'hypervisors.vmware' def initialize @log = Facter::Log.new(self) end def call_the_resolver if vmware? @log.debug('Vmware hypervisor detected') fact_value = {} version = Facter::Resolvers::DmiDecode.resolve(:vmware_version) fact_value[:version] = version if version && !version.empty? return Facter::ResolvedFact.new(FACT_NAME, fact_value) end @log.debug('No Vmware hypervisor detected.') [] end private def vmware? Facter::Resolvers::VirtWhat.resolve(:vm) == 'vmware' || Facter::Resolvers::Linux::DmiBios.resolve(:product_name) == 'VMware' || Facter::Resolvers::Lspci.resolve(:vm) == 'vmware' || Facter::Resolvers::Linux::DmiBios.resolve(:sys_vendor) == 'VMware, Inc.' end end end end end
Version data entries
54 entries across 54 versions & 1 rubygems