# How can I make a job that times out say "Successful" instead of "Failed"?

**URL:** <https://forum.ansible.com/t/how-can-i-make-a-job-that-times-out-say-successful-instead-of-failed/39342>\
**Category:** Get Help\
**Created:** [December 26, 2024, 5:41pm UTC](https://forum.ansible.com/t/how-can-i-make-a-job-that-times-out-say-successful-instead-of-failed/39342 "2024-12-26T17:41:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shanemhartley](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shanemhartley/32/7786_2.png) [@shanemhartley](https://forum.ansible.com/u/shanemhartley)\
**Post date:** [December 26, 2024, 5:41pm UTC](https://forum.ansible.com/t/how-can-i-make-a-job-that-times-out-say-successful-instead-of-failed/39342/1 "2024-12-26T17:41:37Z")

</div>

I have a command that I have to run with async flags.

If I run without async it fails due to SSH timeout  
if I put a timeout value in the playbook it fails.  
If I have no timeout value it RUNS FOREVER lol!

I have to make it timeout after an hour on the job template in Ansible Automation Platform,  
The playbook works perfectly however it says “Failed” Job terminated due to timeout

I want it to say Successful, since it worked - any ideas on how to do this?

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [December 26, 2024, 8:58pm UTC](https://forum.ansible.com/t/how-can-i-make-a-job-that-times-out-say-successful-instead-of-failed/39342/2 "2024-12-26T20:58:48Z")

</div>

Failure is normally determined by the action itself, the core engine does override that in case of timeout, but [failed\_when](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html#defining-failure) lets you define the condition.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [January 25, 2025, 8:59pm UTC](https://forum.ansible.com/t/how-can-i-make-a-job-that-times-out-say-successful-instead-of-failed/39342/3 "2025-01-25T20:59:05Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
