diff --git a/manifests/service_validation.pp b/manifests/service_validation.pp index 535b0167..11147393 100644 --- a/manifests/service_validation.pp +++ b/manifests/service_validation.pp @@ -37,6 +37,10 @@ # The provider to use for the exec command; # string; optional; default to 'shell' # +# [*timeout*] +# The maximum time the command should take; +# string; optional; default to '60' +# # [*tries*] # Number of times to retry validation; # string; optional; default to '10' @@ -62,6 +66,7 @@ define openstacklib::service_validation( $try_sleep = '2', $onlyif = undef, $unless = undef, + $timeout = '60', ) { if $onlyif and $unless { @@ -72,6 +77,7 @@ define openstacklib::service_validation( path => $path, provider => $provider, command => $command, + timeout => $timeout, tries => $tries, try_sleep => $try_sleep, onlyif => $onlyif, diff --git a/spec/defines/openstacklib_service_validation_spec.rb b/spec/defines/openstacklib_service_validation_spec.rb index a1262119..26be77ff 100644 --- a/spec/defines/openstacklib_service_validation_spec.rb +++ b/spec/defines/openstacklib_service_validation_spec.rb @@ -36,6 +36,7 @@ describe 'openstacklib::service_validation' do :path => '/usr/bin:/bin:/usr/sbin:/sbin', :provider => 'shell', :command => 'nova list', + :timeout => '60', :tries => '10', :try_sleep => '2', :logoutput => 'on_failure', @@ -56,6 +57,7 @@ describe 'openstacklib::service_validation' do :path => '/usr/bin:/bin:/usr/sbin:/sbin', :provider => 'shell', :command => 'nova list', + :timeout => '60', :tries => '10', :try_sleep => '2', :unless => 'pwd', @@ -76,6 +78,7 @@ describe 'openstacklib::service_validation' do :path => '/usr/bin:/bin:/usr/sbin:/sbin', :provider => 'shell', :command => 'nova list', + :timeout => '60', :tries => '10', :try_sleep => '2', :onlyif => 'pwd',