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