async:Async indicates the Total time to complete the task or its maximum runtime of the task.
poll:poll indicates to Ansible, how often to poll to check if the command has been completed. or how frequently you would like to poll for status. with poll we keep checking whether the job is completed or not. The default poll value is 10 seconds.
pollset to a positive value. Ansible will still block the next task in your playbook, waiting until the async task either completes, fails or times out. However, the task will only time out if it exceeds the timeout limit you set with the
pollset to 0. When you set
poll: 0, Ansible starts the task and immediately moves on to the next task without waiting for a result. Each async task runs until it either completes, fails or times out (runs longer than its
asyncvalue). The playbook run ends without checking back on async tasks.
execute the playbook with
-voption so that we can see the Job ID of first task to check its status later.
async_statusmodule, passing it the job ID that was returned when you ran the original job in the background:
Poll mode is smart so all jobs will be started before polling begins on any machine. Be sure to use a high enough
--forksvalue if you want to get all of your jobs started very quickly. After the time limit (in seconds) runs out (
-B), the process on the remote nodes will be terminated.
linearstrategy, in which all hosts will run each task before any host starts the next task:
serialwhere you can specify the number of servers you would like to process together:
There are some additional options available such as using a percentage.
any_errors_fatal: trueline in the playbook.