Skip to content
This repository was archived by the owner on Dec 5, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions files/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VMwareTools-*.tar.gz
43 changes: 41 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
class vmware::tools {

$vmtoolstgz = 'VMwareTools-8.3.7-341836.tar.gz'
$vmtoolstgz = 'VMwareTools-8.6.0-425873.tar.gz'

# don't use a directory that gets wiped after every reboot!
$workdir = '/usr/local/src/puppet-vmwaretools'
Expand Down Expand Up @@ -67,8 +67,35 @@
notify => Exec['install vmwaretools']
}

case $::operatingsystem {
ubuntu: {
$init_creates = "/etc/init/vmware-tools.conf"
$service_provider = 'upstart'
file { "/etc/init.d/vmware-tools":
ensure => 'absent',
}
}
centos: {
if $::operatingsystemrelease >= 6.0 {
$init_creates = "/etc/init/vmware-tools.conf"
$service_provider = 'upstart'
file { "/etc/init.d/vmware-tools":
ensure => 'absent',
}
}
else {
$init_creates = "/etc/init.d/vmware-tools"
$service_provider = 'redhat'
}
}
default: {
$init_creates = "/etc/init.d/vmware-tools"
$service_provider = 'init'
}
}

exec { "install vmwaretools":
creates => "/etc/init.d/vmware-tools",
creates => $init_creates,
environment => ["PAGER=/bin/cat","DISPLAY=:9"],
cwd => "$workdir/vmware-tools-distrib",
command => "$workdir/vmware-tools-distrib/vmware-install.pl -d --prefix=$install_prefix",
Expand All @@ -91,10 +118,22 @@
command => "$install_prefix/bin/vmware-config-tools.pl -d",
logoutput => false,
timeout => 300,
notify => Exec['cleanup vmwaretmp']
}

exec { "cleanup vmwaretmp":
onlyif => "ls -1d /tmp/vmware-* >/dev/null 2>&1",
environment => ["PAGER=/bin/cat","DISPLAY=:9"],
cwd => "/tmp",
command => "rm -rf /tmp/vmware-*",
logoutput => false,
timeout => 300,
refreshonly => true
}

service { "vmware-tools":
ensure => running,
provider => $service_provider,
enable => true,
hasstatus => true,
require => [ Exec["reconfigure vmwaretools"]],
Expand Down