cephkeyring POSIX group: use usermod

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi
2014-04-13 17:11:09 +02:00
parent 861acfc4cd
commit 5f6b843c39
4 changed files with 12 additions and 4 deletions

View File

@@ -149,10 +149,13 @@ Host *
ensure_resource('group', 'cephkeyring', { ensure_resource('group', 'cephkeyring', {
ensure => 'present' ensure => 'present'
}) })
User<<| title == 'nova' |>> { groups +> 'cephkeyring' }
exec {'add-nova-to-group':
command => 'usermod -a -G cephkeyring nova'
}
ensure_resource('file', "/etc/ceph/ceph.client.${cinder_rbd_user}.keyring", { ensure_resource('file', "/etc/ceph/ceph.client.${cinder_rbd_user}.keyring", {
owner => 'cephkeyring', owner => 'root',
group => 'cephkeyring', group => 'cephkeyring',
mode => '0400', mode => '0400',
require => "Ceph::Key[${cinder_rbd_user}]", require => "Ceph::Key[${cinder_rbd_user}]",

View File

@@ -79,10 +79,13 @@ define cloud::volume::backend::rbd (
ensure_resource('group', 'cephkeyring', { ensure_resource('group', 'cephkeyring', {
ensure => 'present' ensure => 'present'
}) })
User<<| title == 'cinder' |>> { groups +> 'cephkeyring' }
exec {'add-cinder-to-group':
command => 'usermod -a -G cephkeyring cinder'
}
ensure_resource('file', "/etc/ceph/ceph.client.${rbd_user}.keyring", { ensure_resource('file', "/etc/ceph/ceph.client.${rbd_user}.keyring", {
owner => 'cephkeyring', owner => 'root',
group => 'cephkeyring', group => 'cephkeyring',
mode => '0400', mode => '0400',
require => "Ceph::Key[${rbd_user}]", require => "Ceph::Key[${rbd_user}]",

View File

@@ -240,6 +240,7 @@ describe 'cloud::compute::hypervisor' do
should contain_nova_config('DEFAULT/rbd_user').with('value' => 'cinder') should contain_nova_config('DEFAULT/rbd_user').with('value' => 'cinder')
should contain_nova_config('DEFAULT/rbd_secret_uuid').with('value' => 'secrete') should contain_nova_config('DEFAULT/rbd_secret_uuid').with('value' => 'secrete')
should contain_group('cephkeyring').with(:ensure => 'present') should contain_group('cephkeyring').with(:ensure => 'present')
should contain_exec('add-nova-to-group').with(:command => 'usermod -a -G cephkeyring nova')
end end
it 'configure nova-compute with extra parameters' do it 'configure nova-compute with extra parameters' do

View File

@@ -107,6 +107,7 @@ describe 'cloud::volume::storage' do
:os_auth_url => 'http://keystone.host:5000/v2.0' :os_auth_url => 'http://keystone.host:5000/v2.0'
) )
should contain_group('cephkeyring').with(:ensure => 'present') should contain_group('cephkeyring').with(:ensure => 'present')
should contain_exec('add-cinder-to-group').with(:command => 'usermod -a -G cephkeyring cinder')
end end
end end