Skip to content

Commit

Permalink
Allow configuring the rbd keyring name
Browse files Browse the repository at this point in the history
Change-Id: I7342ec1337cf86c0e4bc66b1788e65c53b2878ce
(cherry picked from commit cb0b480)
  • Loading branch information
claytono committed May 21, 2014
1 parent 9cb3885 commit 77fa1ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion manifests/compute/rbd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -71,7 +76,7 @@
}

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']
}

Expand Down
7 changes: 4 additions & 3 deletions spec/classes/nova_compute_rbd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
)
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')
Expand All @@ -61,7 +61,8 @@
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

Expand All @@ -84,7 +85,7 @@
: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
Expand Down

0 comments on commit 77fa1ce

Please sign in to comment.