db: Use ensure_packages to manage backend package

... instead of skipping the resource definition in case the same is
already defined. This allows us to detect any conflicting definitions
defined in multiple manifests.

Change-Id: Id78c6c1553973b57b4b9e7edaf8d029d833f4722
This commit is contained in:
Takashi Kajinami 2023-07-28 13:10:57 +09:00
parent c3293a4953
commit d0dd31ee35
2 changed files with 5 additions and 5 deletions

View File

@ -161,12 +161,12 @@ define oslo::db(
default: {}
}
if $backend_package and !defined(Package[$backend_package]) {
package { $backend_package:
if $backend_package {
ensure_packages($backend_package, {
ensure => $backend_package_ensure,
name => $backend_package,
tag => 'openstack',
}
})
}
}

View File

@ -150,7 +150,7 @@ describe 'oslo::db' do
it 'install the proper backend package' do
is_expected.to contain_package(platform_params[:pymysql_package_name]).with(
:ensure => 'present',
:ensure => 'installed',
:name => platform_params[:pymysql_package_name],
:tag => 'openstack'
)
@ -176,7 +176,7 @@ describe 'oslo::db' do
it 'install the proper backend package' do
is_expected.to contain_package(platform_params[:pysqlite2_package_name]).with(
:ensure => 'present',
:ensure => 'installed',
:name => platform_params[:pysqlite2_package_name],
:tag => 'openstack'
)