Refactored vmware::player class and added vmware::workstation class.
This commit is contained in:
parent
e32b39c4e7
commit
3926e02859
3 changed files with 74 additions and 39 deletions
|
@ -2,3 +2,44 @@
|
|||
import "guest.pp"
|
||||
import "player.pp"
|
||||
import "server.pp"
|
||||
import "workstation.pp"
|
||||
|
||||
# Install VMware bundle package and configure kernel modules
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# $name:
|
||||
# Bundle package name to install.
|
||||
#
|
||||
# === Sample usage
|
||||
#
|
||||
# vmware::bundle { "VMware-Player": }
|
||||
#
|
||||
define vmware::bundle() {
|
||||
|
||||
file { "/usr/local/src/${name}.bundle":
|
||||
ensure => present,
|
||||
source => "puppet:///files/packages/${name}.${architecture}.bundle",
|
||||
links => follow,
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => root,
|
||||
}
|
||||
|
||||
exec { "/usr/local/src/${name}.bundle --console --required":
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
environment => "VMWARE_EULAS_AGREED=yes",
|
||||
refreshonly => true,
|
||||
subscribe => File["/usr/local/src/${name}.bundle"],
|
||||
notify => Exec["vmware-modconfig"],
|
||||
}
|
||||
|
||||
include gcc
|
||||
exec { "vmware-modconfig":
|
||||
command => "vmware-modconfig --console --install-all",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
creates => "/lib/modules/${kernelrelease}/misc/vmci.ko",
|
||||
require => Class["gcc"],
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,43 +1,13 @@
|
|||
|
||||
# Install VMware Player
|
||||
#
|
||||
# Requires following files on puppet server:
|
||||
#
|
||||
# /srv/puppet/files/common/packages/VMware-Player.i386.bundle
|
||||
# /srv/puppet/files/common/packages/VMware-Player.x86_64.bundle
|
||||
#
|
||||
class vmware::player {
|
||||
|
||||
if ! $vmware_player {
|
||||
$vmware_player = "puppet:///files/packages/VMware-Player.${architecture}.bundle"
|
||||
}
|
||||
|
||||
file { "/usr/local/src/VMware-Player.bundle":
|
||||
ensure => present,
|
||||
source => $vmware_player,
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => root,
|
||||
}
|
||||
|
||||
exec { "/usr/local/src/VMware-Player.bundle --console --required":
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
refreshonly => true,
|
||||
subscribe => File["/usr/local/src/VMware-Player.bundle"],
|
||||
}
|
||||
|
||||
custom::file { "/usr/local/src/vmware-kernel-patch.bash":
|
||||
ensure => present,
|
||||
source => "puppet:///files/packages/vmware-kernel-patch.bash",
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => root,
|
||||
require => Exec["/usr/local/src/VMware-Player.bundle --console --required"],
|
||||
}
|
||||
|
||||
exec { "/usr/local/src/vmware-kernel-patch.bash":
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
refreshonly => true,
|
||||
subscribe => File["/usr/local/src/vmware-kernel-patch.bash"],
|
||||
before => Exec["vmware-modconfig --console --install-all"],
|
||||
}
|
||||
|
||||
exec { "vmware-modconfig --console --install-all":
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
creates => "/lib/modules/${kernelrelease}/misc/vmci.ko",
|
||||
}
|
||||
|
||||
vmware::bundle { "VMware-Player": }
|
||||
|
||||
}
|
||||
|
|
24
vmware/manifests/workstation.pp
Normal file
24
vmware/manifests/workstation.pp
Normal file
|
@ -0,0 +1,24 @@
|
|||
|
||||
# Install VMware Workstation
|
||||
#
|
||||
# Requires following files on puppet server:
|
||||
#
|
||||
# /srv/puppet/files/common/packages/VMware-Workstation-Full.i386.bundle
|
||||
# /srv/puppet/files/common/packages/VMware-Workstation-Full.x86_64.bundle
|
||||
#
|
||||
# === Global variables
|
||||
#
|
||||
# $vmware_serial:
|
||||
# Serial number for VMware Workstation.
|
||||
#
|
||||
class vmware::workstation {
|
||||
|
||||
vmware::bundle { "VMware-Workstation-Full": }
|
||||
|
||||
exec { "vmware-set-serial":
|
||||
command => "/usr/lib/vmware/bin/vmware-vmx --new-sn '${vmware_serial}'",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
require => Vmware::Bundle["VMware-Workstation-Full"],
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue