Skip to content

parametrize xtradb packagename #843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
49 changes: 25 additions & 24 deletions manifests/backup/xtrabackup.pp
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
# See README.me for usage.
class mysql::backup::xtrabackup (
$backupuser = '',
$backuppassword = '',
$backupdir = '',
$backupmethod = 'mysqldump',
$backupdirmode = '0700',
$backupdirowner = 'root',
$backupdirgroup = $mysql::params::root_group,
$backupcompress = true,
$backuprotate = 30,
$ignore_events = true,
$delete_before_dump = false,
$backupdatabases = [],
$file_per_database = false,
$include_triggers = true,
$include_routines = false,
$ensure = 'present',
$time = ['23', '5'],
$prescript = false,
$postscript = false,
$execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
$xtrabackup_package_name = $mysql::params::xtrabackup_package_name,
$backupuser = '',
$backuppassword = '',
$backupdir = '',
$backupmethod = 'mysqldump',
$backupdirmode = '0700',
$backupdirowner = 'root',
$backupdirgroup = $mysql::params::root_group,
$backupcompress = true,
$backuprotate = 30,
$ignore_events = true,
$delete_before_dump = false,
$backupdatabases = [],
$file_per_database = false,
$include_triggers = true,
$include_routines = false,
$ensure = 'present',
$time = ['23', '5'],
$prescript = false,
$postscript = false,
$execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
) inherits mysql::params {

package{ 'percona-xtrabackup':
ensure => $ensure,
package{ $xtrabackup_package_name:
ensure => $ensure,
}

cron { 'xtrabackup-weekly':
Expand All @@ -33,7 +34,7 @@
hour => $time[0],
minute => $time[1],
weekday => '0',
require => Package['percona-xtrabackup'],
require => Package[ $xtrabackup_package_name ],
}

cron { 'xtrabackup-daily':
Expand All @@ -43,7 +44,7 @@
hour => $time[0],
minute => $time[1],
weekday => '1-6',
require => Package['percona-xtrabackup'],
require => Package[ $xtrabackup_package_name ],
}

file { 'mysqlbackupdir':
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$client_dev_package_provider = undef
$daemon_dev_package_ensure = 'present'
$daemon_dev_package_provider = undef

$xtrabackup_package_name = 'percona-xtrabackup'

case $::osfamily {
'RedHat': {
Expand Down