From 7f62cc29533b8656343a2b01da61c53cf698f7ca Mon Sep 17 00:00:00 2001
From: Russ Allbery <rra@stanford.edu>
Date: Wed, 11 Sep 2013 21:46:49 -0700
Subject: [PATCH] Rework the open-vm installation rules

Avoid too many levels of redirection through variables and
variables with studly-caps in favor of a single variable.
Default to the jessie and sid package, since that's what we'll
use going forward.  Avoid using regexes; this isn't really a
regex match, and we'll soon be able to delete the lenny case
anyway.
---
 manifests/vmguest.pp | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/manifests/vmguest.pp b/manifests/vmguest.pp
index 35569b3..4620ab5 100644
--- a/manifests/vmguest.pp
+++ b/manifests/vmguest.pp
@@ -11,13 +11,16 @@ class base::vmguest {
 
   case $::operatingsystem {
     'debian', 'ubuntu': {
-      $VMmodules = $::lsbdistcodename ? {
-        /(lenny|squeeze)/ => "open-vm-modules-${::kernelrelease}",
-        /(jessie|sid)/    => 'open-vm-tools-dkms',
-        default           => 'open-vm-dkms',
+      $open_vm_module = $::lsbdistcodename ? {
+        'lenny'   => "open-vm-modules-${::kernelrelease}",
+        'squeeze' => "open-vm-modules-${::kernelrelease}",
+        'wheezy'  => 'open-vm-dkms',
+        default   => 'open-vm-tools-dkms',
+      }
+      package {
+        'open-vm-tools': ensure => installed;
+        $open_vm_module: ensure => installed;
       }
-      $VMToolsPackages = [ 'open-vm-tools', $VMmodules ]
-      package { $VMToolsPackages: ensure => 'installed' }
 
       # udev rules for SCSI I/O timeout.  Needs config on older Debian since
       # open-vm-tools doesn't modify udev like VMwareTools on RHEL.
-- 
GitLab