Skip to content

Use MariaDB for Ubuntu 20.04 #1449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@
}

'Debian': {
if $::operatingsystem == 'Debian' {
if $facts['os']['name'] == 'Debian' or
($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '20.04') >= 0) {
$provider = 'mariadb'
} else { # Ubuntu
} else {
$provider = 'mysql'
}
if $provider == 'mariadb' {
Expand Down
2 changes: 1 addition & 1 deletion manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}

#Debian: Creating world readable directories before installing.
case $::operatingsystem {
case $facts['os']['family'] {
'Debian': {
if $managed_dirs {
$managed_dirs.each | $entry | {
Expand Down
3 changes: 1 addition & 2 deletions spec/acceptance/00_mysql_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class { 'mysql::server':
},
databases => {
'somedb' => {
ensure => 'present',
charset => #{fetch_charset},
ensure => 'present',
},
}
}
Expand Down
3 changes: 0 additions & 3 deletions spec/acceptance/01_mysql_db_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class { 'mysql::server':
mysql::db { 'spec1':
user => 'root1',
password => 'password',
charset => #{fetch_charset},
}
MANIFEST
end
Expand Down Expand Up @@ -43,7 +42,6 @@ class { 'mysql::server': override_options => { 'root_password' => 'password' } }
user => 'root1',
password => 'password',
sql => '/tmp/spec.sql',
charset => #{fetch_charset},
}
MANIFEST
end
Expand All @@ -68,7 +66,6 @@ class { 'mysql::server': override_options => { 'root_password' => 'password' } }
user => 'root1',
password => 'password',
dbname => 'realdb',
charset => #{fetch_charset},
}
MANIFEST
end
Expand Down
4 changes: 0 additions & 4 deletions spec/acceptance/04_mysql_backup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class { 'mysql::server': root_password => 'password' }
]:
user => 'backup',
password => 'secret',
charset => #{fetch_charset},
}

class { 'mysql::server::backup':
Expand Down Expand Up @@ -73,7 +72,6 @@ class { 'mysql::server': root_password => 'password' }
]:
user => 'backup',
password => 'secret',
charset => #{fetch_charset},
}

class { 'mysql::server::backup':
Expand Down Expand Up @@ -138,7 +136,6 @@ class { 'mysql::server': root_password => 'password' }
]:
user => 'backup',
password => 'secret',
charset => #{fetch_charset},
}
case $facts['os']['family'] {
/Debian/: {
Expand Down Expand Up @@ -259,7 +256,6 @@ class { 'mysql::server': root_password => 'password' }
]:
user => 'backup',
password => 'secret',
charset => #{fetch_charset},
}
case $facts['os']['family'] {
/Debian/: {
Expand Down
5 changes: 2 additions & 3 deletions spec/acceptance/types/mysql_database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class { 'mysql::server': }
describe 'creating database' do
pp = <<-MANIFEST
mysql_database { 'spec_db':
ensure => present,
charset => #{fetch_charset},
ensure => present,
}
MANIFEST
it 'works without errors' do
Expand All @@ -38,7 +37,7 @@ class { 'mysql::server': }
collate => 'latin1_swedish_ci',
}
mysql_database { 'spec_utf8':
charset => #{fetch_charset},
charset => 'utf8',
collate => 'utf8_general_ci',
}
MANIFEST
Expand Down
4 changes: 1 addition & 3 deletions spec/acceptance/types/mysql_grant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ class { 'mysql::server':
$dbSubnet = '10.10.10.%'

mysql_database { 'foo':
ensure => present,
charset => '#{fetch_charset}',
ensure => present,
}

exec { 'mysql-create-table':
Expand Down Expand Up @@ -686,7 +685,6 @@ class { 'mysql::server': override_options => { 'root_password' => 'password' } }
user => 'root1',
password => 'password',
sql => '/tmp/grant_spec_table.sql',
charset => #{fetch_charset},
}
MANIFEST
it 'creates table' do
Expand Down
8 changes: 0 additions & 8 deletions spec/spec_helper_acceptance_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ def export_locales
LitmusHelper.instance.run_shell('. ~/.bashrc')
end

def fetch_charset
@charset ||= if os[:family] == 'ubuntu' && os[:release] =~ %r{^20\.04}
'utf8mb3'
else
'utf8'
end
end

RSpec.configure do |c|
c.before :suite do
if os[:family] == 'debian' || os[:family] == 'ubuntu'
Expand Down