2013-09-13 19:04:42 +02:00
|
|
|
# See README.me for usage.
|
|
|
|
class mysql::server::backup (
|
2015-01-27 22:08:37 +01:00
|
|
|
$backupuser = undef,
|
|
|
|
$backuppassword = undef,
|
|
|
|
$backupdir = undef,
|
|
|
|
$backupdirmode = '0700',
|
|
|
|
$backupdirowner = 'root',
|
|
|
|
$backupdirgroup = 'root',
|
|
|
|
$backupcompress = true,
|
|
|
|
$backuprotate = 30,
|
|
|
|
$ignore_events = true,
|
2013-09-13 19:04:42 +02:00
|
|
|
$delete_before_dump = false,
|
2015-01-27 22:08:37 +01:00
|
|
|
$backupdatabases = [],
|
|
|
|
$file_per_database = false,
|
2015-04-29 15:52:37 +02:00
|
|
|
$include_routines = false,
|
2015-05-11 22:40:28 +02:00
|
|
|
$include_triggers = false,
|
2015-01-27 22:08:37 +01:00
|
|
|
$ensure = 'present',
|
|
|
|
$time = ['23', '5'],
|
2015-08-05 22:15:25 +02:00
|
|
|
$prescript = false,
|
2015-01-27 22:08:37 +01:00
|
|
|
$postscript = false,
|
|
|
|
$execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
|
|
|
|
$provider = 'mysqldump',
|
2013-09-13 19:04:42 +02:00
|
|
|
) {
|
|
|
|
|
2015-08-05 22:15:25 +02:00
|
|
|
if $prescript and $provider =~ /(mysqldump|mysqlbackup)/ {
|
|
|
|
warn("The \$prescript option is not currently implemented for the ${provider} backup provider.")
|
|
|
|
}
|
|
|
|
|
2015-02-19 19:55:24 +01:00
|
|
|
create_resources('class', {
|
2015-01-27 22:08:37 +01:00
|
|
|
"mysql::backup::${provider}" => {
|
|
|
|
'backupuser' => $backupuser,
|
|
|
|
'backuppassword' => $backuppassword,
|
|
|
|
'backupdir' => $backupdir,
|
|
|
|
'backupdirmode' => $backupdirmode,
|
|
|
|
'backupdirowner' => $backupdirowner,
|
|
|
|
'backupdirgroup' => $backupdirgroup,
|
|
|
|
'backupcompress' => $backupcompress,
|
|
|
|
'backuprotate' => $backuprotate,
|
|
|
|
'ignore_events' => $ignore_events,
|
|
|
|
'delete_before_dump' => $delete_before_dump,
|
|
|
|
'backupdatabases' => $backupdatabases,
|
|
|
|
'file_per_database' => $file_per_database,
|
2015-04-29 15:52:37 +02:00
|
|
|
'include_routines' => $include_routines,
|
|
|
|
'include_triggers' => $include_triggers,
|
2015-01-27 22:08:37 +01:00
|
|
|
'ensure' => $ensure,
|
|
|
|
'time' => $time,
|
2015-08-05 22:15:25 +02:00
|
|
|
'prescript' => $prescript,
|
2015-01-27 22:08:37 +01:00
|
|
|
'postscript' => $postscript,
|
|
|
|
'execpath' => $execpath,
|
|
|
|
}
|
|
|
|
})
|
2013-09-13 19:04:42 +02:00
|
|
|
|
|
|
|
}
|