# Three questions regarding asynchronous jobs

**URL:** <https://forum.ansible.com/t/three-questions-regarding-asynchronous-jobs/16758>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [November 12, 2014, 2:14pm UTC](https://forum.ansible.com/t/three-questions-regarding-asynchronous-jobs/16758 "2014-11-12T14:14:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ingmar\_Schlecht](https://avatars.discourse-cdn.com/v4/letter/i/e79b87/32.png) [@Ingmar\_Schlecht](https://forum.ansible.com/u/Ingmar_Schlecht)\
**Post date:** [November 12, 2014, 2:14pm UTC](https://forum.ansible.com/t/three-questions-regarding-asynchronous-jobs/16758/1 "2014-11-12T14:14:30Z")

</div>

Hi there,

just three short questions regarding async jobs.

1.) How can I check the async\_status of a “fire and forget” job on all my servers at once? So instead of checking a specific server’s job id 115503716196.18657 (mind the dot) I would like to basically check 115503716196.\*, which doesn’t work. Also just “115503716196” doesn’t work.

2.) Is there a way to kill “fire and forget” async jobs?

3.) Is there some sort of garbage collection being done for the ~/.ansible\_async/ directory or does that grow forever?

Here’s a bit more explanation regarding just my first question, how I can check the async\_status of a job on all my servers at once:

Say I’m executing an async job like that:

ansible all -B 90 -P 0 -a “sleep 80”

I get a confirmation of successful start like this:

background launch…

ip\_srv1 | success \>\> {  
“ansible\_job\_id”: “115503716196.18657”,  
“results\_file”: “/home/ubuntu/.ansible\_async/115503716196.18657”,  
“started”: 1  
}

ip\_srv2 | success \>\> {  
“ansible\_job\_id”: “115503716196.6532”,  
“results\_file”: “/home/ubuntu/.ansible\_async/115503716196.6532”,  
“started”: 1  
}

Now, is there a way to check the status of the job on all servers at once?

I tried the obvious choice first and did:

ansible all -m async\_status -a “jid=115503716196”

However, this just results in:

ip\_srv1 | FAILED \>\> {  
“ansible\_job\_id”: “115503716196”,  
“failed”: true,  
“msg”: “could not find job”  
}

ip\_srv2 | FAILED \>\> {  
“ansible\_job\_id”: “115503716196”,  
“failed”: true,  
“msg”: “could not find job”  
}

Only if I do:

ansible all -m async\_status -a “jid=115503716196.18657”

I get what I want - but of course only for the server of which I typed in the concret job id.

54.171.202.93 | success \>\> {  
“ansible\_job\_id”: “115503716196.18657”,  
“changed”: false,  
“results\_file”: “/home/ubuntu/.ansible\_async/115503716196.18657”,  
“started”: 1  
}

54.72.229.37 | FAILED \>\> {  
“ansible\_job\_id”: “115503716196.18657”,  
“failed”: true,  
“msg”: “could not find job”  
}

Cheers  
Ingmar

---

<div class="post-metadata">

**Author:** ![Ingmar\_Schlecht](https://avatars.discourse-cdn.com/v4/letter/i/e79b87/32.png) [@Ingmar\_Schlecht](https://forum.ansible.com/u/Ingmar_Schlecht)\
**Post date:** [December 4, 2014, 9:25pm UTC](https://forum.ansible.com/t/three-questions-regarding-asynchronous-jobs/16758/2 "2014-12-04T21:25:26Z")

</div>

Hi there,

just bumping my old question up again.

Especially the first and second question are still of high interest for me (nobody using async jobs in the way I do?):

1.) How can I check the async\_status of a “fire and forget” job on all my servers at once? So instead of checking a specific server’s job id 115503716196.18657 (mind the dot) I would like to basically check 115503716196.\*, which doesn’t work. Also just “115503716196” doesn’t work.

2.) Is there a way to kill “fire and forget” async jobs?

Best  
Ingmar

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [December 5, 2014, 12:29am UTC](https://forum.ansible.com/t/three-questions-regarding-asynchronous-jobs/16758/3 "2014-12-05T00:29:44Z")

</div>

1. async\_status works on a particular JID but cannot be called on wildcards.

2. killing fire and forget jobs? Not presently.

3. For the async directory you would want to delete the leftover files manually. I believe non “fire and forget” jobs do delete the file.
