-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathparams.pp
90 lines (82 loc) · 2.96 KB
/
params.pp
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# == Class: vmwaretools::params
#
# This class handles parameters for the vmwaretools module, including the logic
# that decided if we should install a new version of VMware Tools.
#
# == Actions:
#
# None
#
# === Authors:
#
# Craig Watson <craig@cwatson.org>
#
# === Copyright:
#
# Copyright (C) Craig Watson
# Published under the Apache License v2.0
#
class vmwaretools::params {
if $facts['vmwaretools_version'] == 'not installed' {
# If nothing is installed, deploy.
$deploy_files = true
} elsif versioncmp($::vmwaretools::version,$facts['vmwaretools_version']) == 0 {
# If versions are the same, do not deploy.
$deploy_files = false
} elsif versioncmp($::vmwaretools::version,$facts['vmwaretools_version']) < 0 {
# Action would be a downgrade
if $::vmwaretools::prevent_downgrade == true {
$deploy_files = false
} else {
$deploy_files = true
}
} elsif versioncmp($::vmwaretools::version,$facts['vmwaretools_version']) > 0 {
# Action would be an upgrade
if $::vmwaretools::prevent_upgrade == true {
$deploy_files = false
} else {
$deploy_files = true
}
}
if ($::vmwaretools::archive_url == 'puppet') or ($::vmwaretools::archive_url =~ /^puppet:\/\//) {
$download_vmwaretools = false
} else {
$download_vmwaretools = true
}
if $::vmwaretools::force_install == true {
if (versioncmp($::vmwaretools::version, '10.0' >= 0)) {
$install_command = "${::vmwaretools::working_dir}/vmware-tools-distrib/vmware-install.pl -d -f"
} else {
$install_command = "echo 'yes' | ${::vmwaretools::working_dir}/vmware-tools-distrib/vmware-install.pl"
}
} else {
$install_command = "${::vmwaretools::working_dir}/vmware-tools-distrib/vmware-install.pl -d"
}
# Workaround for 'purge' bug on RH-based systems
# https://projects.puppetlabs.com/issues/2833
# https://projects.puppetlabs.com/issues/11450
# https://tickets.puppetlabs.com/browse/PUP-1198
$purge_package_ensure = $facts['os']['family'] ? {
'RedHat' => absent,
'Suse' => absent,
default => purged,
}
$awk_path = $facts['os']['family'] ? {
'RedHat' => '/bin/awk',
'Debian' => '/usr/bin/awk',
default => '/usr/bin/awk',
}
$clean_failed = $::vmwaretools::clean_failed_download ? {
true => '1',
default => '0'
}
$redhat_devel_package = "kernel-devel-${facts[kernelrelease]}"
$purge_package_list = [ 'open-vm-dkms', 'vmware-tools-services',
'vmware-tools-foundation', 'open-vm-tools-desktop',
'open-vm-source', 'open-vm-toolbox', 'open-vm-tools',
'open-vm-tools-dbg', 'open-vm-tools-gui', 'vmware-kmp-debug',
'vmware-kmp-default', 'vmware-kmp-pae', 'vmware-kmp-trace',
'vmware-guest-kmp-debug', 'vmware-guest-kmp-default',
'vmware-guest-kmp-desktop', 'vmware-guest-kmp-pae',
'libvmtools-devel', 'libvmtools0' ]
}