# Wait for output of command

**URL:** <https://forum.ansible.com/t/wait-for-output-of-command/17376>\
**Category:** Ansible Project\
**Created:** [January 26, 2015, 9:33pm UTC](https://forum.ansible.com/t/wait-for-output-of-command/17376 "2015-01-26T21:33:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Olliver1](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Mark\_Olliver1](https://forum.ansible.com/u/Mark_Olliver1)\
**Post date:** [January 26, 2015, 9:33pm UTC](https://forum.ansible.com/t/wait-for-output-of-command/17376/1 "2015-01-26T21:33:33Z")

</div>

Hi,

I have a command that I need to wait for a completed output from which may take an hour how can I tell ansible to wait (ideally with a timeout so that if it does not get a completed status within the hour then it errors).

The command is as follows:  
ec2-describe-conversion-tasks --region us-east-1

you can run the command many times, one of the fields gives a status so once the field changes to completed then the job is ok and can continue.

Thanks

Mark

---

<div class="post-metadata">

**Author:** ![James\_Martin1](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@James\_Martin1](https://forum.ansible.com/u/James_Martin1)\
**Post date:** [January 29, 2015, 4:36am UTC](https://forum.ansible.com/t/wait-for-output-of-command/17376/2 "2015-01-29T04:36:23Z")

</div>

Looks like you want to use a do-until-loop:

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

- James
