|
3 | 3 | # @api private |
4 | 4 | # |
5 | 5 | class mysql::backup::mysqldump ( |
6 | | - $backupuser = '', |
7 | | - Variant[String, Sensitive[String]] $backuppassword = '', |
8 | | - $backupdir = '', |
9 | | - $maxallowedpacket = '1M', |
10 | | - $backupdirmode = '0700', |
11 | | - $backupdirowner = 'root', |
12 | | - $backupdirgroup = $mysql::params::root_group, |
13 | | - $backupcompress = true, |
14 | | - $backuprotate = 30, |
15 | | - $backupmethod = 'mysqldump', |
16 | | - $backup_success_file_path = undef, |
17 | | - $ignore_events = true, |
18 | | - $delete_before_dump = false, |
19 | | - $backupdatabases = [], |
20 | | - $file_per_database = false, |
21 | | - $include_triggers = false, |
22 | | - $include_routines = false, |
23 | | - $ensure = 'present', |
24 | | - $time = ['23', '5'], |
25 | | - $prescript = false, |
26 | | - $postscript = false, |
27 | | - $execpath = '/usr/bin:/usr/sbin:/bin:/sbin', |
28 | | - $optional_args = [], |
29 | | - $mysqlbackupdir_ensure = 'directory', |
30 | | - $mysqlbackupdir_target = undef, |
31 | | - $incremental_backups = false, |
32 | | - $install_cron = true, |
33 | | - $compression_command = 'bzcat -zc', |
34 | | - $compression_extension = '.bz2', |
35 | | - $backupmethod_package = undef, |
36 | | - Array[String] $excludedatabases = [], |
| 6 | + String $backupuser = '', |
| 7 | + Variant[String, Sensitive[String]] $backuppassword = '', |
| 8 | + String $backupdir = '', |
| 9 | + String[1] $maxallowedpacket = '1M', |
| 10 | + String[1] $backupdirmode = '0700', |
| 11 | + String[1] $backupdirowner = 'root', |
| 12 | + String[1] $backupdirgroup = $mysql::params::root_group, |
| 13 | + Boolean $backupcompress = true, |
| 14 | + Variant[Integer, String[1]] $backuprotate = 30, |
| 15 | + String[1] $backupmethod = 'mysqldump', |
| 16 | + Optional[String[1]] $backup_success_file_path = undef, |
| 17 | + Boolean $ignore_events = true, |
| 18 | + Boolean $delete_before_dump = false, |
| 19 | + Array[String[1]] $backupdatabases = [], |
| 20 | + Boolean $file_per_database = false, |
| 21 | + Boolean $include_triggers = false, |
| 22 | + Boolean $include_routines = false, |
| 23 | + Enum['present', 'absent'] $ensure = 'present', |
| 24 | + Variant[Array[String[1]], Array[Integer]] $time = ['23', '5'], |
| 25 | + Variant[Boolean, String[1], Array[String[1]]] $prescript = false, |
| 26 | + Variant[Boolean, String[1], Array[String[1]]] $postscript = false, |
| 27 | + String[1] $execpath = '/usr/bin:/usr/sbin:/bin:/sbin', |
| 28 | + Array[String[1]] $optional_args = [], |
| 29 | + String[1] $mysqlbackupdir_ensure = 'directory', |
| 30 | + Optional[String[1]] $mysqlbackupdir_target = undef, |
| 31 | + Boolean $incremental_backups = false, |
| 32 | + Boolean $install_cron = true, |
| 33 | + String[1] $compression_command = 'bzcat -zc', |
| 34 | + String[1] $compression_extension = '.bz2', |
| 35 | + Optional[String[1]] $backupmethod_package = undef, |
| 36 | + Array[String] $excludedatabases = [], |
37 | 37 | ) inherits mysql::params { |
38 | 38 | $backuppassword_unsensitive = if $backuppassword =~ Sensitive { |
39 | 39 | $backuppassword.unwrap |
40 | 40 | } else { |
41 | 41 | $backuppassword |
42 | 42 | } |
43 | 43 |
|
44 | | - unless $::osfamily == 'FreeBSD' { |
| 44 | + unless $facts['os']['family'] == 'FreeBSD' { |
45 | 45 | if $backupcompress and $compression_command == 'bzcat -zc' { |
46 | 46 | ensure_packages(['bzip2']) |
47 | 47 | Package['bzip2'] -> File['mysqlbackup.sh'] |
|
69 | 69 | } |
70 | 70 |
|
71 | 71 | if $install_cron { |
72 | | - if $::osfamily == 'RedHat' { |
| 72 | + if $facts['os']['family'] == 'RedHat' { |
73 | 73 | ensure_packages('cronie') |
74 | | - } elsif $::osfamily != 'FreeBSD' { |
| 74 | + } elsif $facts['os']['family'] != 'FreeBSD' { |
75 | 75 | ensure_packages('cron') |
76 | 76 | } |
77 | 77 | } |
|
0 commit comments