File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 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
4246class 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
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
Original file line number Diff line number Diff line change 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' )
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
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
You can’t perform that action at this time.
0 commit comments