@ -236,11 +236,13 @@ class LinuxVirtual(Virtual):
# In older Linux Kernel versions, /sys filesystem is not available
# In older Linux Kernel versions, /sys filesystem is not available
# dmidecode is the safest option to parse virtualization related values
# dmidecode is the safest option to parse virtualization related values
dmi_bin = self . module . get_bin_path ( ' dmidecode ' )
dmi_bin = self . module . get_bin_path ( ' dmidecode ' )
# We still want to continue even if dmidecode is not available
if dmi_bin is not None :
( rc , out , err ) = self . module . run_command ( ' %s -s system-product-name ' % dmi_bin )
( rc , out , err ) = self . module . run_command ( ' %s -s system-product-name ' % dmi_bin )
if rc == 0 :
if rc == 0 :
# Strip out commented lines (specific dmidecode output)
# Strip out commented lines (specific dmidecode output)
vendor_name = ' ' . join ( [ line . strip ( ) for line in out . splitlines ( ) if not line . startswith ( ' # ' ) ] )
vendor_name = ' ' . join ( [ line . strip ( ) for line in out . splitlines ( ) if not line . startswith ( ' # ' ) ] )
if vendor_name in [ ' VMware Virtual Platform ' , ' VMware7,1 ' ] :
if vendor_name . startwith ( ' VMware ' ) :
virtual_facts [ ' virtualization_type ' ] = ' VMware '
virtual_facts [ ' virtualization_type ' ] = ' VMware '
virtual_facts [ ' virtualization_role ' ] = ' guest '
virtual_facts [ ' virtualization_role ' ] = ' guest '