Allow configuring the rbd keyring name

Change-Id: I7342ec1337cf86c0e4bc66b1788e65c53b2878ce
This commit is contained in:
Clayton O'Neill
2014-04-22 16:04:47 +00:00
parent 0249428f29
commit cb0b48016a
2 changed files with 10 additions and 4 deletions

View File

@@ -38,12 +38,17 @@
# Required to use cephx.
# Default to false.
#
# [*rbd_keyring*]
# (optional) The keyring name to use when retrieving the RBD secret
# Default to 'client.nova'
#
class nova::compute::rbd (
$libvirt_rbd_user,
$libvirt_rbd_secret_uuid = false,
$libvirt_images_rbd_pool = 'rbd',
$libvirt_images_rbd_ceph_conf = '/etc/ceph/ceph.conf',
$rbd_keyring = 'client.nova',
) {
include nova::params
@@ -71,7 +76,7 @@ class nova::compute::rbd (
}
exec { 'set-secret-value virsh':
command => '/usr/bin/virsh secret-set-value --secret $(cat /etc/nova/virsh.secret) --base64 $(ceph auth get-key client.nova)',
command => "/usr/bin/virsh secret-set-value --secret $(cat /etc/nova/virsh.secret) --base64 $(ceph auth get-key ${rbd_keyring})",
require => Exec['get-or-set virsh secret']
}

View File

@@ -50,7 +50,7 @@ describe 'nova::compute::rbd' do
)
end
it 'configure nova.conf with overriden parameters' do
it 'configure nova.conf with overridden parameters' do
should contain_nova_config('libvirt/images_type').with_value('rbd')
should contain_nova_config('libvirt/images_rbd_pool').with_value('AnotherPool')
should contain_nova_config('libvirt/images_rbd_ceph_conf').with_value('/tmp/ceph.conf')
@@ -61,7 +61,8 @@ describe 'nova::compute::rbd' do
context 'when using cephx' do
before :each do
params.merge!(
:libvirt_rbd_secret_uuid => 'UUID'
:libvirt_rbd_secret_uuid => 'UUID',
:rbd_keyring => 'client.rbd_test'
)
end
@@ -84,7 +85,7 @@ describe 'nova::compute::rbd' do
:require => 'File[/etc/nova/secret.xml]'
)
should contain_exec('set-secret-value virsh').with(
:command => "/usr/bin/virsh secret-set-value --secret $(cat /etc/nova/virsh.secret) --base64 $(ceph auth get-key client.nova)"
:command => "/usr/bin/virsh secret-set-value --secret $(cat /etc/nova/virsh.secret) --base64 $(ceph auth get-key client.rbd_test)"
)
end
end