TECHIES WORLD

For Techs.... Techniques.... Technologies....

BashLinux

Ansible Error: "async task did not complete within the requested time"

"async task did not complete within the requested time"

This error happens due to one drawback of async module in Ansible.

Async module requires a timeout value in its configuration. If the execution time exceeds the configured value, the task will fail with the above error.

So we should have an idea regarding approximate time of task completion and need to configure the timeout value as higher than this.

Sample playbook snippet using async module is given below.

- name: Install MySQL
  package: name=mysql state=present 
  async: 60
  poll: 5 

This playbook is for installing the MySQL package. Here we can see that the value of async is configured as 60 seconds. If the MySQL installation takes more than 60 seconds to complete, this task will fail.

So we need to tweak the async value according to the approximate process completion time.

That's all…

Leave a Reply