puppet how to make puppet to wait for a few seconds

icn picture icn · Jan 23, 2013 · Viewed 10.7k times · Source

I would like to run a webservice and wait for a few seconds after to get the result.

What is the best way to achieve a wait in puppet ?

Answer

iamauser picture iamauser · Jan 23, 2013

You could use the linux sleep command with exec and stage it to run after the web-service. something like :

exec { 'wait_for_my_web_service' :
  require => Service["my_web_service"],
  command => "sleep 10 && /run/my/command/to/get/results/from/the/web/service",
  path => "/usr/bin:/bin",
}