keyring: use exec to manage cephkeyring group
- Add 'nova' user to 'cephkeyring' group with ensure_resource - Add 'cinder' user to 'cephkeyring' group with ensure_resource - Update fixtures & Puppetfile to lastest commit in puppet-cinder stable/havana - Add a unit test with multiple RBD backends
This commit is contained in:
parent
edea0a06a5
commit
af67eb64cb
@ -150,9 +150,10 @@ Host *
|
|||||||
ensure => 'present'
|
ensure => 'present'
|
||||||
})
|
})
|
||||||
|
|
||||||
@user { 'nova': groups => 'cephkeyring' }
|
ensure_resource ('exec','add-nova-to-group', {
|
||||||
User <| title == nova |>
|
'command' => 'usermod -a -G cephkeyring nova',
|
||||||
realize User[nova]
|
'unless' => 'groups nova | grep cephkeyring'
|
||||||
|
})
|
||||||
|
|
||||||
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',
|
||||||
|
@ -80,9 +80,10 @@ define cloud::volume::backend::rbd (
|
|||||||
ensure => 'present'
|
ensure => 'present'
|
||||||
})
|
})
|
||||||
|
|
||||||
@user { 'cinder': groups => 'cephkeyring' }
|
ensure_resource ('exec','add-cinder-to-group', {
|
||||||
User <| title == cinder |>
|
'command' => 'usermod -a -G cephkeyring cinder',
|
||||||
realize User[cinder]
|
'unless' => 'groups cinder | grep cephkeyring'
|
||||||
|
})
|
||||||
|
|
||||||
ensure_resource('file', "/etc/ceph/ceph.client.${rbd_user}.keyring", {
|
ensure_resource('file', "/etc/ceph/ceph.client.${rbd_user}.keyring", {
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
|
@ -240,6 +240,10 @@ 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',
|
||||||
|
:unless => 'groups nova | grep cephkeyring'
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configure nova-compute with extra parameters' do
|
it 'configure nova-compute with extra parameters' do
|
||||||
|
@ -107,6 +107,10 @@ 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',
|
||||||
|
:unless => 'groups cinder | grep cephkeyring'
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user