Ubuntu/Debian: Install qemu-block-extra when rbd backend is used

In Ubuntu Jammy, the qemu-block-extra package is no longer required by
the qemu-utils package and should be additionally installed to use rbd
backend.

Change-Id: I2ae6ed374dda55f8f68c3be5449b1fcd2a890123
This commit is contained in:
Takashi Kajinami
2022-11-21 15:55:14 +09:00
parent 69d4a6d51d
commit 449507e1a9
3 changed files with 40 additions and 4 deletions

View File

@@ -78,8 +78,12 @@
# [*ceph_client_ensure*]
# (optional) Ensure value for ceph client package.
# Defaults to 'present'.
#
# [*package_ensure*]
# (optional) The state of qemu-block-extra package. This parameter has effect
# only in Ubuntu/Debian.
# Defaults to 'present'
#
class nova::compute::rbd (
$libvirt_rbd_user,
$libvirt_rbd_secret_uuid = false,
@@ -93,6 +97,7 @@ class nova::compute::rbd (
$ephemeral_storage = true,
$manage_ceph_client = true,
$ceph_client_ensure = 'present',
$package_ensure = 'present',
) {
include nova::deps
@@ -107,6 +112,13 @@ class nova::compute::rbd (
}
}
if $::osfamily == 'Debian' {
package { 'qemu-block-extra':
ensure => $package_ensure,
tag => ['openstack', 'nova-support-package'],
}
}
nova_config {
'libvirt/rbd_user': value => $libvirt_rbd_user;
}

View File

@@ -0,0 +1,6 @@
---
features:
- |
The ``nova::compute::rbd`` class now installs the ``qemu-block-extra``
package in Ubuntu or Debian. The ``package_ensure`` parameter can be used
to customize state of the package.

View File

@@ -26,7 +26,7 @@ describe 'nova::compute::rbd' do
{ :libvirt_rbd_user => 'nova' }
end
shared_examples_for 'nova compute rbd' do
shared_examples_for 'nova::compute::rbd' do
it { is_expected.to contain_class('nova::params') }
@@ -168,6 +168,21 @@ describe 'nova::compute::rbd' do
end
end
shared_examples_for 'nova::compute::rbd in Debian' do
it 'should install the qemu-block-extra package' do
is_expected.to contain_package('qemu-block-extra').with(
:ensure => 'present',
:tag => ['openstack', 'nova-support-package'],
)
end
end
shared_examples_for 'nova::compute::rbd in RedHat' do
it 'should not install the qemu-block-extra package' do
is_expected.to_not contain_package('qemu-block-extra')
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
@@ -184,7 +199,10 @@ describe 'nova::compute::rbd' do
{ :ceph_client_package => 'ceph-common' }
end
end
it_configures 'nova compute rbd'
it_configures 'nova::compute::rbd'
if facts[:osfamily] == 'Debian'
it_configures "nova::compute::rbd in #{facts[:osfamily]}"
end
end
end