Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

puppet how to make puppet to wait for a few seconds

Tags:

wait

puppet

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 ?

like image 663
icn Avatar asked Jan 23 '13 00:01

icn


People also ask

Does puppet run in order?

All relationships cause Puppet to manage one or more resources before one or more other resources. By default, unrelated resources are managed in the order in which they're written in their manifest file. If you declare an explicit relationship between resources, it will override this default ordering.

Which command would be used to run puppet?

puppet job run --query 'nodes[certname] { facts {name = "operatingsystem" and value = "Debian" }}' A node group - from the console or the command line: puppet job run --node-group <node-group-id>

What is puppet exec?

In Puppet, the combined configuration to be applied to a host is called a catalog, and the process of applying it is called a run. The Puppet client software is called the agent. Puppet calls the definition of the host itself a node. The Puppet server is called the master. exec resources.


1 Answers

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",
}
like image 74
iamauser Avatar answered Oct 10 '22 22:10

iamauser