Hi Team, Any suggestion on above asked question. Note the async task sets poll=0 to allow subsequent tasks to run concurrently. However even if the async task fails immediately, ansible only fails once it's finished the subsequent tasks and checks on the async task status. Which is really annoying because it can take ~30 minutes to find out that the async task failed 30s in to the run.
Is there a way to preserve the concurrent behaviour but have ansible fail as soon as the async task fails? On Thu, Apr 20, 2023 at 5:44 PM Neha Singh <[email protected]> wrote: > Hi Team > I am using async_status module in ansible task, which is performing > patching on several hosts and till the time that got completed, I will get > waiting message stream on the command line: > > - name: Wait to complete patch installation in managed hosts > async_status: jid={{ item.ansible_job_id }} > register: mh_patch_job_results > *until: mh_patch_job_results.finished* > retries: 240 > delay: 60 > with_items: "{{ mh_patch_jobs.results }}" > > Now, this task failed for one of the hosts, but I didn’t receive the > failed message at the same time. I had to wait for the task to complete on > all other hosts and then at last I got the failed message. > > What I am looking for here is that, Ansible should also report this host > has failed as soon as it failed during patch instead of report at the end > when all hosts are done > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJXXpjYRhkmh%2BnV7bCL%2ByXE8aET4gKkNDyoGowKiRSDakSAK-A%40mail.gmail.com.
