Skip to content

Commit b7c1519

Browse files
committed
Add VMware Workstation Player to virtualization
1 parent fe8beb8 commit b7c1519

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

manifests/params.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@
167167
'source' => 'https://www.virtualbox.org/download/oracle_vbox.asc',
168168
}
169169
}
170+
$vmware_version = '14.0.0-6661328'
171+
$vmware_urlbase = 'https://download3.vmware.com/software/player/file'
172+
$vmware_package = "VMware-Player-${vmware_version}.x86_64.bundle"
173+
170174
} elsif ($::operatingsystem == 'windows') and (versioncmp($::operatingsystemrelease, '7') >= 0) {
171175
#### init ####
172176
include '::chocolatey'

manifests/virtualization/vmware.pp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# vmware.pp
2+
# Install VMware Workstation Player for OS X, Ubuntu, or Windows
3+
# https://www.vmware.com/products/workstation-player.html
4+
#
5+
#
6+
7+
class software::virtualization::vmware (
8+
$ensure = $software::params::software_ensure,
9+
$version = $software::params::vmware_version,
10+
$urlbase = $software::params::vmware_urlbase,
11+
$package = $software::params::vmware_package,
12+
) inherits software::params {
13+
14+
validate_string($ensure)
15+
16+
case $::operatingsystem {
17+
'Debian', 'Ubuntu': {
18+
validate_string($version, $urlbase, $package)
19+
20+
$vmware_installer = "/tmp/${package}"
21+
$vmware_install_cmd = "${vmware_installer} --console --eulas-agreed --required"
22+
$vmware_uninstall_cmd = "${vmware_installer} --uninstall-product=vmware-player --required"
23+
24+
file { $vmware_installer:
25+
source => "${urlbase}/${package}",
26+
owner => 'root',
27+
group => 'root',
28+
mode => '0755',
29+
}
30+
-> exec { $vmware_install_cmd:
31+
path => ['/usr/sbin', '/usr/bin', '/sbin', '/bin'],
32+
# NOTE: This will make it difficult to upgrade to a newer version
33+
# (VMware-Player will need to be uninstalled prior to upgrade)
34+
creates => '/usr/bin/vmplayer',
35+
}
36+
}
37+
default: {
38+
fail("The ${name} class is not supported on ${::operatingsystem}.")
39+
}
40+
}
41+
42+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require 'spec_helper'
2+
3+
describe 'software::virtualization::vmware' do
4+
on_supported_os.each do |os, facts|
5+
context "on #{os}" do
6+
let(:facts) do
7+
facts
8+
end
9+
10+
context 'with defaults' do
11+
if facts[:operatingsystem] =~ /^(Debian|Ubuntu)$/
12+
it { is_expected.to compile.with_all_deps }
13+
else
14+
it { is_expected.to compile.and_raise_error(/is not supported on /) }
15+
end
16+
end
17+
end
18+
end
19+
end

0 commit comments

Comments
 (0)