File tree 2 files changed +49
-1
lines changed
2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 67
67
require => Mysql_user[" ${backupuser} @localhost" ],
68
68
}
69
69
}
70
+ if versioncmp($facts [' mysql_version' ], ' 8' ) >= 0 {
71
+ mysql_grant { "${backupuser}@localhost/performance_schema.keyring_component_status" :
72
+ ensure => $ensure ,
73
+ user => " ${backupuser} @localhost" ,
74
+ table => ' performance_schema.keyring_component_status' ,
75
+ privileges => [' SELECT' ],
76
+ require => Mysql_user[" ${backupuser} @localhost" ],
77
+ }
78
+ mysql_grant { "${backupuser}@localhost/performance_schema.log_status" :
79
+ ensure => $ensure ,
80
+ user => " ${backupuser} @localhost" ,
81
+ table => ' performance_schema.log_status' ,
82
+ privileges => [' SELECT' ],
83
+ require => Mysql_user[" ${backupuser} @localhost" ],
84
+ }
85
+ }
70
86
}
71
87
72
88
if $install_cron {
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ class { 'mysql::server': }
11
11
EOF
12
12
end
13
13
let ( :facts ) do
14
- facts . merge ( root_home : '/root' )
14
+ facts . merge ( root_home : '/root' ,
15
+ mysql_version : '5.7' )
15
16
end
16
17
17
18
let ( :default_params ) do
@@ -113,6 +114,37 @@ class { 'mysql::server': }
113
114
end ,
114
115
)
115
116
. that_requires ( 'Mysql_user[backupuser@localhost]' )
117
+
118
+ is_expected . not_to contain_mysql_grant ( 'backupuser@localhost/performance_schema.keyring_component_status' )
119
+ is_expected . not_to contain_mysql_grant ( 'backupuser@localhost/performance_schema.log_status' )
120
+ end
121
+
122
+ context 'with MySQL version 8.0' do
123
+ let ( :facts ) do
124
+ facts . merge ( mysql_version : '8.0' )
125
+ end
126
+
127
+ it {
128
+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/performance_schema.keyring_component_status' )
129
+ . with (
130
+ ensure : 'present' ,
131
+ user : 'backupuser@localhost' ,
132
+ table : 'performance_schema.keyring_component_status' ,
133
+ privileges :
134
+ [ 'SELECT' ]
135
+ )
136
+ . that_requires ( 'Mysql_user[backupuser@localhost]' )
137
+
138
+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/performance_schema.log_status' )
139
+ . with (
140
+ ensure : 'present' ,
141
+ user : 'backupuser@localhost' ,
142
+ table : 'performance_schema.log_status' ,
143
+ privileges :
144
+ [ 'SELECT' ]
145
+ )
146
+ . that_requires ( 'Mysql_user[backupuser@localhost]' )
147
+ }
116
148
end
117
149
end
118
150
You can’t perform that action at this time.
0 commit comments