Merge "Allow configuring the rbd keyring name"
This commit is contained in:
@@ -38,12 +38,17 @@
|
|||||||
# Required to use cephx.
|
# Required to use cephx.
|
||||||
# Default to false.
|
# Default to false.
|
||||||
#
|
#
|
||||||
|
# [*rbd_keyring*]
|
||||||
|
# (optional) The keyring name to use when retrieving the RBD secret
|
||||||
|
# Default to 'client.nova'
|
||||||
|
#
|
||||||
|
|
||||||
class nova::compute::rbd (
|
class nova::compute::rbd (
|
||||||
$libvirt_rbd_user,
|
$libvirt_rbd_user,
|
||||||
$libvirt_rbd_secret_uuid = false,
|
$libvirt_rbd_secret_uuid = false,
|
||||||
$libvirt_images_rbd_pool = 'rbd',
|
$libvirt_images_rbd_pool = 'rbd',
|
||||||
$libvirt_images_rbd_ceph_conf = '/etc/ceph/ceph.conf',
|
$libvirt_images_rbd_ceph_conf = '/etc/ceph/ceph.conf',
|
||||||
|
$rbd_keyring = 'client.nova',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include nova::params
|
include nova::params
|
||||||
@@ -71,7 +76,7 @@ class nova::compute::rbd (
|
|||||||
}
|
}
|
||||||
|
|
||||||
exec { 'set-secret-value virsh':
|
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']
|
require => Exec['get-or-set virsh secret']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ describe 'nova::compute::rbd' do
|
|||||||
)
|
)
|
||||||
end
|
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_type').with_value('rbd')
|
||||||
should contain_nova_config('libvirt/images_rbd_pool').with_value('AnotherPool')
|
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')
|
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
|
context 'when using cephx' do
|
||||||
before :each do
|
before :each do
|
||||||
params.merge!(
|
params.merge!(
|
||||||
:libvirt_rbd_secret_uuid => 'UUID'
|
:libvirt_rbd_secret_uuid => 'UUID',
|
||||||
|
:rbd_keyring => 'client.rbd_test'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -84,7 +85,7 @@ describe 'nova::compute::rbd' do
|
|||||||
:require => 'File[/etc/nova/secret.xml]'
|
:require => 'File[/etc/nova/secret.xml]'
|
||||||
)
|
)
|
||||||
should contain_exec('set-secret-value virsh').with(
|
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
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user