crontab: ensure the script is run with bash shell

Some distros does not provide a default shell for Keystone user.
We can run the crontab by force shell usage and avoid running
issues.

Change-Id: Ib05522d922fecfbd28aa8a8b092b4d3b47172d00
This commit is contained in:
Emilien Macchi 2014-12-09 10:50:06 -05:00
parent 0df9701dcf
commit c39fca28e6
2 changed files with 4 additions and 4 deletions

View File

@ -64,7 +64,7 @@ class keystone::cron::token_flush (
cron { 'keystone-manage token_flush':
ensure => $ensure,
command => "${sleep}keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1",
environment => 'PATH=/bin:/usr/bin:/usr/sbin',
environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
user => 'keystone',
minute => $minute,
hour => $hour,

View File

@ -11,7 +11,7 @@ describe 'keystone::cron::token_flush' do
should contain_cron('keystone-manage token_flush').with(
:ensure => 'present',
:command => 'keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
:user => 'keystone',
:minute => 1,
:hour => 0,
@ -33,7 +33,7 @@ describe 'keystone::cron::token_flush' do
should contain_cron('keystone-manage token_flush').with(
:ensure => 'present',
:command => 'sleep `expr ${RANDOM} \\% 600`; keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
:user => 'keystone',
:minute => 1,
:hour => 0,
@ -55,7 +55,7 @@ describe 'keystone::cron::token_flush' do
should contain_cron('keystone-manage token_flush').with(
:ensure => 'absent',
:command => 'keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
:user => 'keystone',
:minute => 1,
:hour => 0,