From 041ef06c780971750cbc3b7f62197ab3054e8c63 Mon Sep 17 00:00:00 2001 From: Nemanja Delic Date: Fri, 1 Jul 2016 15:45:35 +0200 Subject: [PATCH] parametrize xtradb package name (#860) --- manifests/backup/xtrabackup.pp | 49 +++++++++++++++++----------------- manifests/params.pp | 1 + 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/manifests/backup/xtrabackup.pp b/manifests/backup/xtrabackup.pp index d43a4e4..185b29f 100644 --- a/manifests/backup/xtrabackup.pp +++ b/manifests/backup/xtrabackup.pp @@ -1,29 +1,30 @@ # See README.me for usage. class mysql::backup::xtrabackup ( - $backupuser = '', - $backuppassword = '', - $backupdir = '', - $maxallowedpacket = '1M', - $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 = '', + $maxallowedpacket = '1M', + $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': + package{ $xtrabackup_package_name: ensure => $ensure, } @@ -34,7 +35,7 @@ class mysql::backup::xtrabackup ( hour => $time[0], minute => $time[1], weekday => '0', - require => Package['percona-xtrabackup'], + require => Package[$xtrabackup_package_name], } cron { 'xtrabackup-daily': @@ -44,7 +45,7 @@ class mysql::backup::xtrabackup ( hour => $time[0], minute => $time[1], weekday => '1-6', - require => Package['percona-xtrabackup'], + require => Package[$xtrabackup_package_name], } file { 'mysqlbackupdir': diff --git a/manifests/params.pp b/manifests/params.pp index 130d816..5b2fea4 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -30,6 +30,7 @@ class mysql::params { $client_dev_package_provider = undef $daemon_dev_package_ensure = 'present' $daemon_dev_package_provider = undef + $xtrabackup_package_name = 'percona-xtrabackup' case $::osfamily {