From 4bbdf6b16d0ccbf93bb58e876097920af1653a55 Mon Sep 17 00:00:00 2001 From: Ryan McKern Date: Wed, 19 Jun 2013 00:00:43 -0400 Subject: [PATCH] Enhance 'kernel_upgrade' across supported OSes kernel_upgrade currently searches for the driver "/lib/modules/${::kernelrelease}/kernel/drivers/scsi/vmw_pvscsi.ko", which isn't reliable on RHEL/CentOS 5. I've added some conditional logic to search for vmxnet3.ko instead, which appears to be universally installed regardless of distro (albeit in different locations across the different versions of RHEL/CentOS). --- manifests/kernel_upgrade.pp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/manifests/kernel_upgrade.pp b/manifests/kernel_upgrade.pp index b602489..ab4f41f 100644 --- a/manifests/kernel_upgrade.pp +++ b/manifests/kernel_upgrade.pp @@ -17,6 +17,21 @@ # class vmwaretools::kernel_upgrade { + # The vmxnet3 driver isn't in the same place across every flavor of Linux, + # so we need to specify where that file is found across the distros. + case $osfamily { + /(?i-mx:debian)/: { + $vmxnet_driver = "/lib/modules/${::kernelrelease}/kernel/drivers/net/vmxnet3/vmxnet3.ko" + } + /(?i-mx:redhat)/: { + $vmxnet_driver = $::lsbmajdistrelease ? { + '5' => "/lib/modules/${::kernelrelease}/misc/vmxnet3.ko", + '6' => "/lib/modules/${::kernelrelease}/kernel/drivers/net/vmxnet3/vmxnet3.ko", + } + } + default: { fail("${::operatingsystem} is unsupported") } + } + if $vmwaretools::params::deploy_files { Exec['vmware_config_tools'] { require => Exec['clean_vmwaretools'], @@ -25,7 +40,7 @@ exec { 'vmware_config_tools': command => '/usr/bin/vmware-config-tools.pl -d', - creates => "/lib/modules/${::kernelrelease}/kernel/drivers/scsi/vmw_pvscsi.ko", + creates => $vmxnet_driver, } }