Merge "MySQL: Remove ineffective systemd drop-in"

This commit is contained in:
Zuul 2021-11-24 22:02:15 +00:00 committed by Gerrit Code Review
commit 064e20ba6a
2 changed files with 1 additions and 50 deletions

View File

@ -47,11 +47,6 @@
# (Optional) Whether TLS in the internal network is enabled or not.
# Defaults to hiera('enable_internal_tls', false)
#
# [*generate_dropin_file_limit*]
# (Optional) Generate a systemd drop-in file to raise the file descriptor
# limit for the mysql service.
# Defaults to false
#
# [*innodb_buffer_pool_size*]
# (Optional) Configure the size of the MySQL buffer pool.
# Defaults to hiera('innodb_buffer_pool_size', undef)
@ -115,7 +110,6 @@ class tripleo::profile::base::database::mysql (
$certificate_specs = {},
$cipher_list = '!SSLv2:kEECDH:kRSA:kEDH:kPSK:+3DES:!aNULL:!eNULL:!MD5:!EXP:!RC4:!SEED:!IDEA:!DES:!SSLv3:!TLSv1',
$enable_internal_tls = hiera('enable_internal_tls', false),
$generate_dropin_file_limit = false,
$innodb_buffer_pool_size = hiera('innodb_buffer_pool_size', undef),
$innodb_log_file_size = undef,
$innodb_lock_wait_timeout = hiera('innodb_lock_wait_timeout', undef),
@ -203,15 +197,6 @@ class tripleo::profile::base::database::mysql (
service_enabled => $manage_resources,
remove_default_accounts => $remove_default_accounts,
}
if $generate_dropin_file_limit and $manage_resources {
# Raise the mysql file limit
::systemd::service_limits { 'mariadb.service':
limits => {
'LimitNOFILE' => 16384
}
}
}
}
$service_names = hiera('enabled_services', undef)

View File

@ -22,45 +22,11 @@ describe 'tripleo::profile::base::database::mysql' do
:mysql_max_connections => 4096,
}
end
shared_examples_for 'tripleo::profile::base::database::mysql' do
before :each do
facts.merge!({ :step => params[:step] })
end
context 'with noha and raise mariadb limit' do
before do
params.merge!({
:generate_dropin_file_limit => true
})
end
it 'should create limit file' do
is_expected.to contain_systemd__service_limits('mariadb.service').with(
:limits => { "LimitNOFILE" => 16384 })
end
end
context 'with noha and do not raise mariadb limit' do
before do
params.merge!({
:generate_dropin_file_limit => false
})
end
it 'should not create limit file' do
is_expected.to_not contain_systemd__service_limits('mariadb.service')
end
end
context 'with ha and raise mariadb limit' do
before do
params.merge!({
:generate_dropin_file_limit => true,
:manage_resources => false,
})
end
it 'should not create limit file in ha' do
is_expected.to_not contain_systemd__service_limits('mariadb.service')
end
end
end
on_supported_os.each do |os, facts|