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
|
# File 'manifests/tungsten/redoreader.pp', line 17
class tungsten::tungsten::redoreader (
$location = false,
) inherits tungsten::params {
include tungsten::prereq
case fileextension($location) {
".rpm": {
# Install the tungsten-replicator package from the provided location
Class["tungsten::prereq"] ->
package { "vmware-continuent-replication-oracle-source":
ensure => present,
provider => rpm,
source => $location,
}
}
".gz": {
# Get the true basename of the file in case it is a .tar.gz file
if fileextension(filebasename($location)) == ".tar" {
$basename = filebasename(filebasename($location))
$arguments = "zxf"
} else {
$basename = filebasename($location)
$arguments = "xf"
}
# Unpack the tungsten-replicator package from the provided location
Class["tungsten::prereq"] ->
exec { "unpack-redo-reader":
path => ["/bin", "/usr/bin"],
cwd => "/opt/continuent/software",
command => "tar $arguments $location",
user => $tungsten::prereq::systemUserName,
creates => "/opt/continuent/software/$basename",
} ~>
exec { "install-redo-reader":
path => ["/bin", "/usr/bin"],
command => "sudo -i -u $tungsten::prereq::systemUserName /opt/continuent/software/$basename/tools/tpm install --tty ",
onlyif => "test -f /etc/tungsten/tungsten.ini",
logoutput => true,
refreshonly => true,
returns => [0, 1],
}
}
default: {
fail("Unable to install the Redo Reader from $location because the file type is not recognized.")
}
}
}
|