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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
# File 'manifests/tungstenmysql/xtrabackup.pp', line 16
class tungsten::tungstenmysql::xtrabackup ( $installXtrabackup = true,
$mySQLBuild = 'percona',
$xtraBackupPackage = 'auto'
) {
if $installXtrabackup == true {
if $mySQLBuild == 'percona' {
if $::osfamily == "RedHat" and $operatingsystemmajrelease == 5 {
notice ("xtrabackup is not supported on ${::operatingsystem}:${operatingsystemmajrelease} based system")
}else {
if $xtraBackupPackage == 'auto' {
package { 'percona-xtrabackup': ensure => 'present' }
} else {
case $::osfamily {
'Redhat': {$provider='rpm'}
'Debian': {$provider='dpkg'}
}
package { "percona-xtrabackup":
provider => $provider,
ensure => present,
source => $download,
}
}
}
} else {
if $::osfamily == "RedHat" {
if ($operatingsystem =~ /(?i:amazon)/) {
$release = $epel_version
} else {
$release = $operatingsystemmajrelease
}
if $release != 5 {
if $xtraBackupPackage == 'auto' {
case $release {
6: { $download = "http://www.percona.com/downloads/XtraBackup/XtraBackup-2.2.8/binary/redhat/6/x86_64/percona-xtrabackup-2.2.8-5059.el6.x86_64.rpm" }
7: { $download = "http://www.percona.com/downloads/XtraBackup/XtraBackup-2.2.8/binary/redhat/7/x86_64/percona-xtrabackup-2.2.8-5059.el7.x86_64.rpm" }
default: { fail("Xtrabackup is not supported on an ${::operatingsystem}:${release} based system.") }
}
} else {
$download = $xtraBackupPackage
}
if ! defined(Package['continuent-wget']) {
package {'continuent-wget': ensure => present, name => "wget", }
}
if ! defined(Package['continuent-rsync']) {
package {'continuent-rsync': ensure => present, name => "rsync", }
}
if $release == 7 {package {'perl-Digest-MD5': ensure=>'present'}}
package {'perl-DBD-MySQL': ensure=>'present'} ->
package {'perl-Time-HiRes': ensure=>'present'} ->
package { "percona-xtrabackup":
provider => "rpm",
ensure => present,
require => Package['continuent-rsync'],
source => $download,
}
} else {
notice ("xtrabackup is not supported on ${::operatingsystem}:${release} based system")
}
} elsif ($operatingsystem =~ /(?i:debian|ubuntu)/) {
if $xtraBackupPackage == 'auto' {
case $::lsbdistcodename {
'squeeze': { $download = "http://www.percona.com/downloads/XtraBackup/XtraBackup-2.2.8/binary/debian/squeeze/x86_64/percona-xtrabackup_2.2.8-5059-1.squeeze_amd64.deb" }
"wheezy": { $download = "http://www.percona.com/downloads/XtraBackup/XtraBackup-2.2.8/binary/debian/wheezy/x86_64/percona-xtrabackup_2.2.8-5059-1.wheezy_amd64.deb" }
'lucid': { $download = "http://www.percona.com/downloads/XtraBackup/XtraBackup-2.2.8/binary/debian/lucid/x86_64/percona-xtrabackup_2.2.8-5059-1.lucid_amd64.deb"}
'precise': { $download = "http://www.percona.com/downloads/XtraBackup/XtraBackup-2.2.8/binary/debian/precise/x86_64/percona-xtrabackup_2.2.8-5059-1.precise_amd64.deb"}
'trusty': { $download = "http://www.percona.com/downloads/XtraBackup/XtraBackup-2.2.8/binary/debian/trusty/x86_64/percona-xtrabackup_2.2.8-5059-1.trusty_amd64.deb" }
default: { fail("Xtrabackup is not supported on an ${::operatingsystem}:${lsbdistcodename} based system.") }
}
} else {
$download = $xtraBackupPackage
}
if ! defined(Package['continuent-wget']) {
package {'continuent-wget': ensure => present, name => "wget", }
}
package {'libdbd-mysql-perl': ensure=>'present'} ->
package { "percona-xtrabackup":
provider => "dpkg",
ensure => present,
source => $download,
}
} else {
fail("Xtrabackup is not supported on an ${::operatingsystem} based system.")
}
}
}
}
|