summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael Kincaid <michael@puppetlabs.com>2011-03-31 16:04:57 -0700
committerAdrien Thebo <adrien.thebo@gmail.com>2011-04-01 18:19:11 -0700
commit3efa9d717572d7a9a2136c50cd863ff9d4c27372 (patch)
tree09becc55e6c945e8008a4d406e36910f24e2f6f3 /lib
parent7c80172fa79105c642f327c59b69f23be2153bb1 (diff)
downloadfacter-3efa9d717572d7a9a2136c50cd863ff9d4c27372.tar.gz
facter-3efa9d717572d7a9a2136c50cd863ff9d4c27372.tar.xz
facter-3efa9d717572d7a9a2136c50cd863ff9d4c27372.zip
(#3856) Add virtualbox detection via lspci (graphics card), dmidecode, and prtdiag for Solaris and corresponding tests. Darwin case is not handled yet.
Diffstat (limited to 'lib')
-rw-r--r--lib/facter/virtual.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index 02802e6..7c649ba 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -104,6 +104,9 @@ Facter.add("virtual") do
# --- look for the vmware video card to determine if it is virtual => vmware.
# --- 00:0f.0 VGA compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter
result = "vmware" if p =~ /VM[wW]are/
+ # --- look for virtualbox video card to determine if it is virtual => virtualbox.
+ # --- 00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter
+ result = "virtualbox" if p =~ /VirtualBox/
# --- look for pci vendor id used by Parallels video card
# --- 01:00.0 VGA compatible controller: Unknown device 1ab8:4005
result = "parallels" if p =~ /1ab8:|[Pp]arallels/
@@ -114,6 +117,7 @@ Facter.add("virtual") do
output.each_line do |pd|
result = "parallels" if pd =~ /Parallels/
result = "vmware" if pd =~ /VMware/
+ result = "virtualbox" if pd =~ /VirtualBox/
end
else
output = Facter::Util::Resolution.exec('prtdiag')
@@ -121,6 +125,7 @@ Facter.add("virtual") do
output.each_line do |pd|
result = "parallels" if pd =~ /Parallels/
result = "vmware" if pd =~ /VMware/
+ result = "virtualbox" if pd =~ /VirtualBox/
end
end
end