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. 

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/85aaa315-a17c-4451-b6dc-dd5ebdb89fa5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to