|
1 # See README.me for usage. |
|
2 class mysql::server::backup ( |
|
3 $backupuser = undef, |
|
4 $backuppassword = undef, |
|
5 $backupdir = undef, |
|
6 $backupdirmode = '0700', |
|
7 $backupdirowner = 'root', |
|
8 $backupdirgroup = 'root', |
|
9 $backupcompress = true, |
|
10 $backuprotate = 30, |
|
11 $ignore_events = true, |
|
12 $delete_before_dump = false, |
|
13 $backupdatabases = [], |
|
14 $file_per_database = false, |
|
15 $include_routines = false, |
|
16 $include_triggers = false, |
|
17 $ensure = 'present', |
|
18 $time = ['23', '5'], |
|
19 $prescript = false, |
|
20 $postscript = false, |
|
21 $execpath = '/usr/bin:/usr/sbin:/bin:/sbin', |
|
22 $provider = 'mysqldump', |
|
23 ) { |
|
24 |
|
25 if $prescript and $provider =~ /(mysqldump|mysqlbackup)/ { |
|
26 warning("The \$prescript option is not currently implemented for the ${provider} backup provider.") |
|
27 } |
|
28 |
|
29 create_resources('class', { |
|
30 "mysql::backup::${provider}" => { |
|
31 'backupuser' => $backupuser, |
|
32 'backuppassword' => $backuppassword, |
|
33 'backupdir' => $backupdir, |
|
34 'backupdirmode' => $backupdirmode, |
|
35 'backupdirowner' => $backupdirowner, |
|
36 'backupdirgroup' => $backupdirgroup, |
|
37 'backupcompress' => $backupcompress, |
|
38 'backuprotate' => $backuprotate, |
|
39 'ignore_events' => $ignore_events, |
|
40 'delete_before_dump' => $delete_before_dump, |
|
41 'backupdatabases' => $backupdatabases, |
|
42 'file_per_database' => $file_per_database, |
|
43 'include_routines' => $include_routines, |
|
44 'include_triggers' => $include_triggers, |
|
45 'ensure' => $ensure, |
|
46 'time' => $time, |
|
47 'prescript' => $prescript, |
|
48 'postscript' => $postscript, |
|
49 'execpath' => $execpath, |
|
50 } |
|
51 }) |
|
52 |
|
53 } |