Merge "Fix ceph keyring permissions"

This commit is contained in:
Jenkins
2015-04-27 10:25:54 +00:00
committed by Gerrit Code Review
4 changed files with 26 additions and 20 deletions

View File

@@ -365,18 +365,16 @@ Host *
# Configure Ceph keyring # Configure Ceph keyring
Ceph::Key <<| title == $cinder_rbd_user |>> Ceph::Key <<| title == $cinder_rbd_user |>>
if defined(Ceph::Key[$cinder_rbd_user]) { ensure_resource(
ensure_resource( 'file',
'file', "/etc/ceph/ceph.client.${cinder_rbd_user}.keyring", {
"/etc/ceph/ceph.client.${cinder_rbd_user}.keyring", { owner => 'root',
owner => 'root', group => 'cephkeyring',
group => 'cephkeyring', mode => '0440',
mode => '0440', require => Ceph::Key[$cinder_rbd_user],
require => Ceph::Key[$cinder_rbd_user], notify => Service['nova-compute'],
notify => Service['nova-compute'], }
} )
)
}
Concat::Fragment <<| title == 'ceph-client-os' |>> Concat::Fragment <<| title == 'ceph-client-os' |>>
} else { } else {

View File

@@ -84,14 +84,12 @@ define cloud::volume::backend::rbd (
# Configure Ceph keyring # Configure Ceph keyring
Ceph::Key <<| title == $rbd_user |>> Ceph::Key <<| title == $rbd_user |>>
if defined(Ceph::Key[$rbd_user]) { ensure_resource('file', "/etc/ceph/ceph.client.${rbd_user}.keyring", {
ensure_resource('file', "/etc/ceph/ceph.client.${rbd_user}.keyring", { owner => 'root',
owner => 'root', group => 'cephkeyring',
group => 'cephkeyring', mode => '0440',
mode => '0440', require => Ceph::Key[$rbd_user],
require => Ceph::Key[$rbd_user], })
})
}
Concat::Fragment <<| title == 'ceph-client-os' |>> Concat::Fragment <<| title == 'ceph-client-os' |>>

View File

@@ -384,6 +384,11 @@ describe 'cloud::compute::hypervisor' do
:command => 'usermod -a -G cephkeyring nova', :command => 'usermod -a -G cephkeyring nova',
:unless => 'groups nova | grep cephkeyring' :unless => 'groups nova | grep cephkeyring'
) )
is_expected.to contain_file('/etc/ceph/ceph.client.cinder.keyring').with({
'owner' => 'root',
'group' => 'cephkeyring',
'mode' => '0440',
})
end end
it 'configure libvirt driver' do it 'configure libvirt driver' do

View File

@@ -157,6 +157,11 @@ describe 'cloud::volume::storage' do
:path => ['/usr/sbin', '/usr/bin', '/bin', '/sbin'], :path => ['/usr/sbin', '/usr/bin', '/bin', '/sbin'],
:unless => 'groups cinder | grep cephkeyring' :unless => 'groups cinder | grep cephkeyring'
) )
is_expected.to contain_file('/etc/ceph/ceph.client.cinder.keyring').with({
'owner' => 'root',
'group' => 'cephkeyring',
'mode' => '0440',
})
end end
end end