Skip to content

Commit 77fa1ce

Browse files
committed
Allow configuring the rbd keyring name
Change-Id: I7342ec1337cf86c0e4bc66b1788e65c53b2878ce (cherry picked from commit cb0b480)
1 parent 9cb3885 commit 77fa1ce

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

manifests/compute/rbd.pp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,17 @@
3838
# Required to use cephx.
3939
# Default to false.
4040
#
41+
# [*rbd_keyring*]
42+
# (optional) The keyring name to use when retrieving the RBD secret
43+
# Default to 'client.nova'
44+
#
4145

4246
class nova::compute::rbd (
4347
$libvirt_rbd_user,
4448
$libvirt_rbd_secret_uuid = false,
4549
$libvirt_images_rbd_pool = 'rbd',
4650
$libvirt_images_rbd_ceph_conf = '/etc/ceph/ceph.conf',
51+
$rbd_keyring = 'client.nova',
4752
) {
4853

4954
include nova::params
@@ -71,7 +76,7 @@
7176
}
7277

7378
exec { 'set-secret-value virsh':
74-
command => '/usr/bin/virsh secret-set-value --secret $(cat /etc/nova/virsh.secret) --base64 $(ceph auth get-key client.nova)',
79+
command => "/usr/bin/virsh secret-set-value --secret $(cat /etc/nova/virsh.secret) --base64 $(ceph auth get-key ${rbd_keyring})",
7580
require => Exec['get-or-set virsh secret']
7681
}
7782

spec/classes/nova_compute_rbd_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
)
5151
end
5252

53-
it 'configure nova.conf with overriden parameters' do
53+
it 'configure nova.conf with overridden parameters' do
5454
should contain_nova_config('libvirt/images_type').with_value('rbd')
5555
should contain_nova_config('libvirt/images_rbd_pool').with_value('AnotherPool')
5656
should contain_nova_config('libvirt/images_rbd_ceph_conf').with_value('/tmp/ceph.conf')
@@ -61,7 +61,8 @@
6161
context 'when using cephx' do
6262
before :each do
6363
params.merge!(
64-
:libvirt_rbd_secret_uuid => 'UUID'
64+
:libvirt_rbd_secret_uuid => 'UUID',
65+
:rbd_keyring => 'client.rbd_test'
6566
)
6667
end
6768

@@ -84,7 +85,7 @@
8485
:require => 'File[/etc/nova/secret.xml]'
8586
)
8687
should contain_exec('set-secret-value virsh').with(
87-
:command => "/usr/bin/virsh secret-set-value --secret $(cat /etc/nova/virsh.secret) --base64 $(ceph auth get-key client.nova)"
88+
:command => "/usr/bin/virsh secret-set-value --secret $(cat /etc/nova/virsh.secret) --base64 $(ceph auth get-key client.rbd_test)"
8889
)
8990
end
9091
end

0 commit comments

Comments
 (0)