Hi,

here is an example: trigger a reboot (no need to wait)

do not wait for task completion -  poll:0
you cannot wait in that case as the System will reboot breaking the ssh
connection.



- name: Reboot the system
  shell: sleep 2 && shutdown -r now "Ansible reboot triggered"
  async: 1
  poll: 0

another example would be to trigger an action that take a long time but you
don't care about the result
like: recursively delete a whole hierarchy of directories/files on a system


hope this help.


2017-07-11 16:01 GMT+02:00 Luvpreet Singh <[email protected]>:

> I have read the asynchronous actions and polling in Ansible docs. But I
> could not understand it.
>
> I understand that poll means the time interval after which the status of
> the job will be checked.
>
> I think Async means the interval for which to keep the connection open. If
> yes, What will happen after the connection is closed ? Will the task be
> completed ?
>
> And I really did not understand the fire and forget tasks.
>
> Can somebody please make it a bit clearer with the help of an easy example
> ?
>
> --
> 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/a10abc4e-b130-4029-9020-d40ad2362508%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/a10abc4e-b130-4029-9020-d40ad2362508%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAB1FMuSaxmmgc7Ob3UUhkx3FTzieya%2BQ7%3DDHKjUtE_0PrNdhjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to