# module - wait\_for - suggestion/offer of enhancement

**URL:** <https://forum.ansible.com/t/module-wait-for-suggestion-offer-of-enhancement/14854>\
**Category:** Ansible Developer\
**Created:** [March 25, 2014, 2:54pm UTC](https://forum.ansible.com/t/module-wait-for-suggestion-offer-of-enhancement/14854 "2014-03-25T14:54:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Hunt](https://avatars.discourse-cdn.com/v4/letter/b/bb73d2/32.png) [@Bryan\_Hunt](https://forum.ansible.com/u/Bryan_Hunt)\
**Post date:** [March 25, 2014, 2:54pm UTC](https://forum.ansible.com/t/module-wait-for-suggestion-offer-of-enhancement/14854/1 "2014-03-25T14:54:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [March 25, 2014, 3:01pm UTC](https://forum.ansible.com/t/module-wait-for-suggestion-offer-of-enhancement/14854/2 "2014-03-25T15:01:45Z")

</div>

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

[http://docs.ansible.com/playbooks\_loops.html#do-until-loops](http://docs.ansible.com/playbooks_loops.html#do-until-loops)

---

<div class="post-metadata">

**Author:** ![Bryan\_Hunt](https://avatars.discourse-cdn.com/v4/letter/b/bb73d2/32.png) [@Bryan\_Hunt](https://forum.ansible.com/u/Bryan_Hunt)\
**Post date:** [March 25, 2014, 3:25pm UTC](https://forum.ansible.com/t/module-wait-for-suggestion-offer-of-enhancement/14854/3 "2014-03-25T15:25:45Z")

</div>

Great suggestion Serge, and much easier, thanks!
