Skip to content

Instantly share code, notes, and snippets.

@evrardjp
Last active May 9, 2017 14:25
Show Gist options
  • Save evrardjp/56da60826da8a5a978683626282c6ca1 to your computer and use it in GitHub Desktop.
Save evrardjp/56da60826da8a5a978683626282c6ca1 to your computer and use it in GitHub Desktop.
Async bug or not bug. Here is the question.
---
- hosts: localhost
gather_facts: no
connection: local
tasks:
# This should have finished at worst 13 seconds (+1, poll frequency) after the start
- shell: "sleep {{ item }}"
async: 20
poll: 1
with_items:
- 9
- 7
- 13
- 11
@evrardjp
Copy link
Author

evrardjp commented May 9, 2017


PLAY [localhost] ********************************************************************************************************************************************************************

TASK [command] **********************************************************************************************************************************************************************
changed: [localhost] => (item=9) => {"ansible_job_id": "293350696203.30461", "changed": true, "cmd": "sleep 9", "delta": "0:00:09.004775", "end": "2017-05-09 14:15:27.104503", "finished": 1, "item": 9, "rc": 0, "start": "2017-05-09 14:15:18.099728", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
changed: [localhost] => (item=7) => {"ansible_job_id": "199981395199.30574", "changed": true, "cmd": "sleep 7", "delta": "0:00:07.004524", "end": "2017-05-09 14:15:34.362792", "finished": 1, "item": 7, "rc": 0, "start": "2017-05-09 14:15:27.358268", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
changed: [localhost] => (item=13) => {"ansible_job_id": "274078183703.30669", "changed": true, "cmd": "sleep 13", "delta": "0:00:13.005118", "end": "2017-05-09 14:15:48.363892", "finished": 1, "item": 13, "rc": 0, "start": "2017-05-09 14:15:35.358774", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
changed: [localhost] => (item=11) => {"ansible_job_id": "806225950244.30832", "changed": true, "cmd": "sleep 11", "delta": "0:00:11.005086", "end": "2017-05-09 14:16:00.104379", "finished": 1, "item": 11, "rc": 0, "start": "2017-05-09 14:15:49.099293", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

PLAY RECAP **************************************************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0

Have a look at the start time and finish time. They were all running one after each other.
Whatever the strategy is.

I don't know what to expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment