diff options
author | Tim Smith <tsmith84@gmail.com> | 2019-11-08 15:22:54 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2019-11-08 15:22:54 -0800 |
commit | 954de754a8bb040989c303cd0cb2e0279cd4c9d5 (patch) | |
tree | 33474479c2cb52716943d5d57bf85f4e63b9ca1a /lib/chef/resource | |
parent | db1704d2259841f60382ca6c14dc1a6446ea939b (diff) | |
download | chef-954de754a8bb040989c303cd0cb2e0279cd4c9d5.tar.gz |
Update documentation and add a Test Kitchen test
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r-- | lib/chef/resource/chef_sleep.rb | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/chef/resource/chef_sleep.rb b/lib/chef/resource/chef_sleep.rb index 6ae70c1f31..c1f31e3fe1 100644 --- a/lib/chef/resource/chef_sleep.rb +++ b/lib/chef/resource/chef_sleep.rb @@ -25,8 +25,36 @@ class Chef unified_mode true - description "Use the chef_sleep resource to sleep for a number of seconds during a #{Chef::Dist::PRODUCT} run." + description "Use the chef_sleep resource to sleep for a number of seconds during a #{Chef::Dist::PRODUCT} run. This resource should only be used when a command or service exits successfuly , but is not fully ready for the next step of the recipe." introduced "15.5" + examples <<~DOC + Sleep for 10 seconds + ```ruby + chef_sleep '10' + ``` + + Sleep for 10 seconds with a friendly resource name for logging + ```ruby + chef_sleep 'wait for the service to start' do + seconds 10 + end + ```` + + Use a notify from another resource to sleep only when necessary + ```ruby + service 'Service that is slow to start and reports as started' do + service_name 'my_database' + action :start + notifies :sleep, chef_sleep['wait for service start'] + end + + chef_sleep 'wait for service start' do + seconds 30 + action :nothing + end + ``` + DOC + property :seconds, [String, Integer], description: "The number of seconds to sleep.", |