|
48 | 48 | password_hash => mysql::password($backuppassword),
|
49 | 49 | require => Class['mysql::server::root_password'],
|
50 | 50 | }
|
51 |
| - |
52 |
| - if $::osfamily == 'debian' and $::operatingsystemmajrelease == '11' { |
53 |
| - mysql_grant { "${backupuser}@localhost/*.*": |
| 51 | + if versioncmp($facts['mysql_version'], '8') >= 0 { |
| 52 | + if $::osfamily == 'debian' and $::operatingsystemmajrelease == '11' { |
| 53 | + mysql_grant { "${backupuser}@localhost/*.*": |
| 54 | + ensure => $ensure, |
| 55 | + user => "${backupuser}@localhost", |
| 56 | + table => '*.*', |
| 57 | + privileges => ['BINLOG MONITOR', 'RELOAD', 'PROCESS', 'LOCK TABLES', 'BACKUP_ADMIN'], |
| 58 | + require => Mysql_user["${backupuser}@localhost"], |
| 59 | + } |
| 60 | + } |
| 61 | + else { |
| 62 | + mysql_grant { "${backupuser}@localhost/*.*": |
| 63 | + ensure => $ensure, |
| 64 | + user => "${backupuser}@localhost", |
| 65 | + table => '*.*', |
| 66 | + privileges => ['RELOAD', 'PROCESS', 'LOCK TABLES', 'REPLICATION CLIENT', 'BACKUP_ADMIN'], |
| 67 | + require => Mysql_user["${backupuser}@localhost"], |
| 68 | + } |
| 69 | + } |
| 70 | + mysql_grant { "${backupuser}@localhost/performance_schema.keyring_component_status": |
54 | 71 | ensure => $ensure,
|
55 | 72 | user => "${backupuser}@localhost",
|
56 |
| - table => '*.*', |
57 |
| - privileges => ['BINLOG MONITOR', 'RELOAD', 'PROCESS', 'LOCK TABLES'], |
| 73 | + table => 'performance_schema.keyring_component_status', |
| 74 | + privileges => ['SELECT'], |
58 | 75 | require => Mysql_user["${backupuser}@localhost"],
|
59 | 76 | }
|
60 |
| - } |
61 |
| - else { |
62 |
| - mysql_grant { "${backupuser}@localhost/*.*": |
| 77 | + mysql_grant { "${backupuser}@localhost/performance_schema.log_status": |
63 | 78 | ensure => $ensure,
|
64 | 79 | user => "${backupuser}@localhost",
|
65 |
| - table => '*.*', |
66 |
| - privileges => ['RELOAD', 'PROCESS', 'LOCK TABLES', 'REPLICATION CLIENT'], |
| 80 | + table => 'performance_schema.log_status', |
| 81 | + privileges => ['SELECT'], |
67 | 82 | require => Mysql_user["${backupuser}@localhost"],
|
68 | 83 | }
|
69 | 84 | }
|
| 85 | + else { |
| 86 | + if $::osfamily == 'debian' and $::operatingsystemmajrelease == '11' { |
| 87 | + mysql_grant { "${backupuser}@localhost/*.*": |
| 88 | + ensure => $ensure, |
| 89 | + user => "${backupuser}@localhost", |
| 90 | + table => '*.*', |
| 91 | + privileges => ['BINLOG MONITOR', 'RELOAD', 'PROCESS', 'LOCK TABLES'], |
| 92 | + require => Mysql_user["${backupuser}@localhost"], |
| 93 | + } |
| 94 | + } |
| 95 | + else { |
| 96 | + mysql_grant { "${backupuser}@localhost/*.*": |
| 97 | + ensure => $ensure, |
| 98 | + user => "${backupuser}@localhost", |
| 99 | + table => '*.*', |
| 100 | + privileges => ['RELOAD', 'PROCESS', 'LOCK TABLES', 'REPLICATION CLIENT'], |
| 101 | + require => Mysql_user["${backupuser}@localhost"], |
| 102 | + } |
| 103 | + } |
| 104 | + } |
70 | 105 | }
|
71 | 106 |
|
72 | 107 | if $install_cron {
|
|
0 commit comments