keyring permissions: fix PATH

PATH needs to include:
- /usr/sbin and /usr/bin
- /sbin and /bin

for running grep and groups commands.

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi 2014-04-26 15:29:26 +02:00
parent f8de2fb334
commit d894d334ec
4 changed files with 4 additions and 4 deletions

View File

@ -147,7 +147,7 @@ Host *
ensure_resource ('exec','add-nova-to-group', { ensure_resource ('exec','add-nova-to-group', {
'command' => 'usermod -a -G cephkeyring nova', 'command' => 'usermod -a -G cephkeyring nova',
'path' => ['/usr/sbin', '/sbin'], 'path' => ['/usr/sbin', '/usr/bin', '/bin', '/sbin'],
'unless' => 'groups nova | grep cephkeyring' 'unless' => 'groups nova | grep cephkeyring'
}) })

View File

@ -82,7 +82,7 @@ define cloud::volume::backend::rbd (
ensure_resource ('exec','add-cinder-to-group', { ensure_resource ('exec','add-cinder-to-group', {
'command' => 'usermod -a -G cephkeyring cinder', 'command' => 'usermod -a -G cephkeyring cinder',
'path' => ['/usr/sbin', '/sbin'], 'path' => ['/usr/sbin', '/usr/bin', '/bin', '/sbin'],
'unless' => 'groups cinder | grep cephkeyring' 'unless' => 'groups cinder | grep cephkeyring'
}) })

View File

@ -240,7 +240,7 @@ describe 'cloud::compute::hypervisor' do
should contain_exec('add-nova-to-group').with( should contain_exec('add-nova-to-group').with(
:command => 'usermod -a -G cephkeyring nova', :command => 'usermod -a -G cephkeyring nova',
:unless => 'groups nova | grep cephkeyring', :unless => 'groups nova | grep cephkeyring',
:path => ['/usr/sbin', '/sbin'] :path => ['/usr/sbin', '/usr/bin', '/bin', '/sbin']
) )
end end

View File

@ -111,7 +111,7 @@ describe 'cloud::volume::storage' do
should contain_group('cephkeyring').with(:ensure => 'present') should contain_group('cephkeyring').with(:ensure => 'present')
should contain_exec('add-cinder-to-group').with( should contain_exec('add-cinder-to-group').with(
:command => 'usermod -a -G cephkeyring cinder', :command => 'usermod -a -G cephkeyring cinder',
:path => ['/usr/sbin', '/sbin'], :path => ['/usr/sbin', '/usr/bin', '/bin', '/sbin'],
:unless => 'groups cinder | grep cephkeyring' :unless => 'groups cinder | grep cephkeyring'
) )
end end