module - wait_for - suggestion/offer of enhancement

The idea behind wait_for is really good, and essential when dealing with slow starting networking services, but in certain cases it may not be enough.

The functionality of wait_for is to wait for either a file to be created, or for a particular network socket to be listening.

But, that may not be enough. In the case of containerized services such as those running in Erlang nodes, the network port may be receiving messages, but the actual service has not yet started.

It would be useful to add onto this module, the ability to wait until a specific command returns successfully. The command could be a script, or it could be a provided utility, in the case of riak and it’s ilk, riak ping is a command which is used to verify the liveliness of a particular node (it returns pong and exits with code 0 on success, 1 on failure).

Would this functionality be useful to add ?

Thanks,

Bryan Hunt

Did you consider until loops? These can be combined with almost any module:

http://docs.ansible.com/playbooks_loops.html#do-until-loops

Great suggestion Serge, and much easier, thanks!