ceph keyring: manage group via virtual resource

Manage the group membership with a Puppet Virtual Resource.

Bug #402
This commit is contained in:
Emilien Macchi 2014-04-14 10:27:59 +02:00
parent 5f6b843c39
commit 538491c5d2
4 changed files with 6 additions and 8 deletions

View File

@ -150,9 +150,9 @@ Host *
ensure => 'present' ensure => 'present'
}) })
exec {'add-nova-to-group': @user { 'nova': groups => 'cephkeyring' }
command => 'usermod -a -G cephkeyring nova' User <| title == nvoa |>
} realize User[nova]
ensure_resource('file', "/etc/ceph/ceph.client.${cinder_rbd_user}.keyring", { ensure_resource('file', "/etc/ceph/ceph.client.${cinder_rbd_user}.keyring", {
owner => 'root', owner => 'root',

View File

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

View File

@ -240,7 +240,6 @@ 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,7 +107,6 @@ 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