Purge [libvirt] rbd_secret_uuid when unused

... instead of leaving it unmanaged.

Change-Id: I40f5186a3a6694dcd309570249573a85a0b0b259
This commit is contained in:
Takashi Kajinami 2022-06-16 00:18:52 +09:00
parent a6c166e8e8
commit dcb5d932ec
2 changed files with 5 additions and 0 deletions

View File

@ -143,6 +143,10 @@ class nova::compute::rbd (
unless => "/usr/bin/virsh secret-get-value ${libvirt_rbd_secret_uuid} | grep ${libvirt_key}",
require => Exec['get-or-set virsh secret'],
}
} else {
nova_config {
'libvirt/rbd_secret_uuid': ensure => absent;
}
}
if $ephemeral_storage {

View File

@ -31,6 +31,7 @@ describe 'nova::compute::rbd' do
it { is_expected.to contain_class('nova::params') }
it 'configure nova.conf with default parameters' do
is_expected.to contain_nova_config('libvirt/rbd_secret_uuid').with_ensure('absent')
is_expected.to contain_nova_config('libvirt/images_rbd_pool').with_value('rbd')
is_expected.to contain_nova_config('libvirt/images_rbd_ceph_conf').with_value('/etc/ceph/ceph.conf')
is_expected.to contain_nova_config('libvirt/rbd_user').with_value('nova')