Fix mariadb repo setup

Instead of always creating the mariadb default repository we should
only do it when requested by the node environment.

Do this implicitly via the mariadb_*_install resources that have
an option to decide whether a repo should be set up or not.

Bump minor version for stable branch.

Change-Id: I4f62dd7a7df247ddb787553bef58ca81d8e062fb
(cherry picked from commit 7ed8573899)
This commit is contained in:
Jens Harbott 2020-09-16 10:39:44 +02:00
parent f52213d03d
commit 93fe7f936a
5 changed files with 5 additions and 9 deletions

View File

@ -20,6 +20,8 @@
# MariaDB version
default['openstack']['mariadb']['version'] = '10.3'
# Whether to set up mariadb repo
default['openstack']['mariadb']['setup_repo'] = true
# Storage engine, base OpenStack requires the InnoDB flavor
default['openstack']['mysql']['default-storage-engine'] = 'InnoDB'
# InnoDB lock mode for generating auto-increment values

View File

@ -3,7 +3,7 @@ maintainer 'openstack-chef'
maintainer_email 'openstack-discuss@lists.openstack.org'
license 'Apache-2.0'
description 'Provides the shared database configuration for OpenStack'
version '19.1.0'
version '19.2.0'
%w(ubuntu redhat centos).each do |os|
supports os

View File

@ -15,12 +15,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
mariadb_repository 'default' do
version node['openstack']['mariadb']['version']
end
mariadb_client_install 'default' do
version node['openstack']['mariadb']['version']
setup_repo node['openstack']['mariadb']['setup_repo']
end
node['openstack']['db']['python_packages']['mariadb'].each do |pkg|

View File

@ -36,6 +36,7 @@ include_recipe 'openstack-ops-database::mariadb-client'
mariadb_server_install 'default' do
version node['openstack']['mariadb']['version']
password super_password
setup_repo node['openstack']['mariadb']['setup_repo']
action [:install, :create]
end

View File

@ -14,10 +14,6 @@ describe 'openstack-ops-database::mariadb-client' do
runner.converge(described_recipe)
end
it do
expect(chef_run).to add_mariadb_repository('default').with(version: '10.3')
end
it do
expect(chef_run).to install_mariadb_client_install('default').with(version: '10.3')
end