[Pkg-puppet-devel] [SCM] Packaging of Facter for debian branch, upstream, updated. 3a39dd8353b6308cf49522990104cc63e55d7cda
Paul Nasrat
pnasrat at googlemail.com
Fri Jan 29 17:22:27 UTC 2010
The following commit has been merged in the upstream branch:
commit 56760d34f070db4d7bb8e5fcfb7939fe3074bf49
Author: Jim Pirzyk <jim+puppet at pirzyk.org>
Date: Fri May 15 08:27:23 2009 +0100
Facter #2120 - Solaris support for Facter[virtual]
Initial support for virtual vmware fact on Solaris
Tested on VMWare Fusion and OpenSolaris
Paul
diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index 203d306..37381d4 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -48,25 +48,31 @@ Facter.add("virtual") do
end
if result == "physical"
- output = Facter::Util::Resolution.exec('lspci')
- if not output.nil?
- output.each_line do |p|
- # --- 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/
- end
+ output = Facter::Util::Resolution.exec('vmware-checkvm')
+ if $?.exitstatus == 0
+ result = "vmware"
else
- output = Facter::Util::Resolution.exec('dmidecode')
+ output = Facter::Util::Resolution.exec('lspci')
if not output.nil?
- output.each_line do |pd|
- result = "vmware" if pd =~ /VMware|Parallels/
+ output.each_line do |p|
+ # --- 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/
end
else
- output = Facter::Util::Resolution.exec('prtdiag')
+ output = Facter::Util::Resolution.exec('dmidecode')
if not output.nil?
output.each_line do |pd|
result = "vmware" if pd =~ /VMware|Parallels/
end
+ elsif Facter[:kernel].value == 'SunOS' and Facter[:kernelrelease].value == '5.10'
+ # prtdiag only works on Solaris 10 x86 hosts
+ output = Facter::Util::Resolution.exec('prtdiag')
+ if not output.nil?
+ output.each_line do |pd|
+ result = "vmware" if pd =~ /VMware|Parallels/
+ end
+ end
end
end
end
--
Packaging of Facter for debian
More information about the Pkg-puppet-devel
mailing list