I am trying to run async jobs with ‘poll=0’ (fire & forget) and then check the job status via async_status. However, I don’t know how to properly check for job completion.
Of course, the ‘until: job_result.finished’ fails because the ‘finished’ attribute is NOT populated until the job has finished. I have tried doing ‘until: hasattr(job_result,‘finished’)’ as well, but this also fails.
Thanks, but my experience with adding the poll interval seems to make an async task into a blocking, synchronous task. The playbook does not proceed until the job is finished or the timeout is reached.
What I’d like to do is launch tasks A & B asynchronously so that they execute in parallel. Then I want the playbook to continue with task C only after tasks A & B have both finished.
May I suggest a simple code change here, for consideration by the group?
In the async_status module, always return the ‘finished’ attribute (with a 0 or 1 value) instead of doing so ONLY when the job is finished. This would make it trivial to perform the parallelization/waiting that today is not available, using the do…until mentioned in the original post. The code change to async_status would probably be as simple as changing line 84: