-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvmwaretools.pp
More file actions
50 lines (48 loc) · 1.63 KB
/
vmwaretools.pp
File metadata and controls
50 lines (48 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class base::vmwaretools {
$openvmtools = ["open-vm-source", "open-vm-tools"]
$prereqs = ["gcc-c++","kernel-devel"]
$mountpoint = "/mnt/puppet"
$share = "/data/globalshare"
$server = "everest.dchoc.net"
package { $prereqs:
ensure => present,
}
package { $openvmtools:
ensure => purged,
}
# we need to mount the nfs share to get at the install script
exec { "create mountpoint":
path => ["/bin", "/sbin", "/usr/bin", "/usr/sbin"],
command => "mkdir -p ${mountpoint}",
unless => "ls ${mountpoint}",
}
exec { "mount puppetshare":
command => "/bin/mount -t nfs ${server}:${share} $mountpoint",
timeout => 300,
logoutput => true,
require => Exec["create mountpoint"],
}
exec { "unmount puppetshare":
command => "/bin/umount $mountpoint",
timeout => 300,
logoutput => true,
require => Exec["install vmwaretools"],
}
exec { "install vmwaretools":
creates => "/etc/vmware-tools",
environment => ["PAGER=/bin/cat","DISPLAY=:9"],
cwd => "/mnt/puppet/vmware-tools-distrib",
command => "/mnt/puppet/vmware-tools-distrib/vmware-install.pl --default",
logoutput => true,
timeout => 300,
require => Exec["mount puppetshare"],
}
### Start the service
service { "vmware-tools":
ensure => running,
enable => true,
hasstatus => false,
pattern => "vmware-guestd --background",
require => [Package[$prereqs], Exec["install vmwaretools"]],
}
}