@@ -268,51 +268,13 @@ class { 'mysql::server':
268268 end
269269 end
270270
271- # On Ubuntu 20.04 'ALL' now returns as the sum of it's constitute parts and so require a specific test
272- describe 'ALL privilege on newer MySQL versions' , if : os [ :family ] == 'ubuntu' && os [ :release ] =~ %r{^20\. 04} do
273- pp_one = <<-MANIFEST
274- mysql_user { 'all@localhost':
275- ensure => present,
276- }
277- mysql_grant { 'all@localhost/*.*':
278- user => 'all@localhost',
279- privileges => ['ALL'],
280- table => '*.*',
281- require => Mysql_user['all@localhost'],
282- }
283- MANIFEST
284- it "create ['ALL'] privs" do
285- apply_manifest ( pp_one , catch_failures : true )
286- end
287-
288- pp_two = <<-MANIFEST
289- mysql_user { 'all@localhost':
290- ensure => present,
291- }
292- mysql_grant { 'all@localhost/*.*':
293- user => 'all@localhost',
294- privileges => ['ALTER', 'ALTER ROUTINE', 'CREATE', 'CREATE ROLE', 'CREATE ROUTINE', 'CREATE TABLESPACE', 'CREATE TEMPORARY TABLES', 'CREATE USER', 'CREATE VIEW', 'DELETE', 'DROP', 'DROP ROLE', 'EVENT', 'EXECUTE', 'FILE', 'INDEX', 'INSERT', 'LOCK TABLES', 'PROCESS', 'REFERENCES', 'RELOAD', 'REPLICATION CLIENT', 'REPLICATION SLAVE', 'SELECT', 'SHOW DATABASES', 'SHOW VIEW', 'SHUTDOWN', 'SUPER', 'TRIGGER', 'UPDATE'],
295- table => '*.*',
296- require => Mysql_user['all@localhost'],
297- }
298- MANIFEST
299- it "create ['ALL'] constitute parts privs" do
300- apply_manifest ( pp_two , catch_changes : true )
301- end
302- end
303-
304271 describe 'complex test' do
305- # On Ubuntu 20.04 'ALL' now returns as the sum of it's constitute parts and so is no longer idempotent when set
306- privileges = if os [ :family ] == 'ubuntu' && os [ :release ] =~ %r{^20\. 04}
307- "['SELECT', 'INSERT', 'UPDATE']"
308- else
309- "['ALL']"
310- end
311272 pp = <<-MANIFEST
312273 $dbSubnet = '10.10.10.%'
313274
314275 mysql_database { 'foo':
315- ensure => present,
276+ ensure => present,
277+ charset => '#{ fetch_charset } ',
316278 }
317279
318280 exec { 'mysql-create-table':
@@ -325,7 +287,7 @@ class { 'mysql::server':
325287 Mysql_grant {
326288 ensure => present,
327289 options => ['GRANT'],
328- privileges => #{ privileges } ,
290+ privileges => ['ALL'] ,
329291 table => '*.*',
330292 require => [ Mysql_database['foo'], Exec['mysql-create-table'] ],
331293 }
@@ -724,6 +686,7 @@ class { 'mysql::server': override_options => { 'root_password' => 'password' } }
724686 user => 'root1',
725687 password => 'password',
726688 sql => '/tmp/grant_spec_table.sql',
689+ charset => #{ fetch_charset } ,
727690 }
728691 MANIFEST
729692 it 'creates table' do
0 commit comments