# best location for async\_status tasks in a playbook with multiple roles

**URL:** <https://forum.ansible.com/t/best-location-for-async-status-tasks-in-a-playbook-with-multiple-roles/19701>\
**Category:** Ansible Project\
**Created:** [November 5, 2015, 11:03pm UTC](https://forum.ansible.com/t/best-location-for-async-status-tasks-in-a-playbook-with-multiple-roles/19701 "2015-11-05T23:03:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CyberCyber](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@CyberCyber](https://forum.ansible.com/u/CyberCyber)\
**Post date:** [November 5, 2015, 11:03pm UTC](https://forum.ansible.com/t/best-location-for-async-status-tasks-in-a-playbook-with-multiple-roles/19701/1 "2015-11-05T23:03:49Z")

</div>

Say you have a playbook with multiple roles, for example:

roles:

- A
- B
- C

in role A’s or B’s tasks/main.yml, there are a few tasks which are asynchronous fire and forget, do not poll tasks, for example:

`

- name: do the thing (asynchronously)  
shell: Zhu Li do the thing  
args:  
creates: /etc/thething  
async: 300  
poll: 0  
register: thething\_created  
`

these tasks need to be checked on at the end of the playbook run before the handlers execute like so:

`

- name: verify that the thing was done  
async\_status: jid={{ thething\_created.ansible\_job\_id }}  
register: thething\_result  
until: thething\_result.finished  
retries: 100  
`

currently I have these async\_status tasks at the end of C’s tasks/main.yml. If role C is removed or conditionally executed, it will cause the entire playbook to fail.

Where is the best location to put these kind of tasks? I could always create another role called D that contains just these tasks but I’m interested to learn how the rest of you are handling this.
