Is Ansible really parallel?

Disable cowsay. Or install cowsay to fix this.

This is actually very easy to verify with a long running task, you can
login on each host and see it running at the same time or just look at
the code (one of the advantages of OSS). Ansible does things in
parallel, currently per host (I have looked at and even modified this
code). There are a few of reasons I can think of on why that this test
might be misleading you.

- If the first one had to actually update packages and the 2nd one did
not, it might account for taking the same amount of time.

- If control persist is enabled, the first one had to establish the
connections from scratch, while the 2nd just reused them. Secure
connections are costly and make a noticeable difference in time.

- Another reason can be locking your known_hosts file for updates
forces serialization of the 1st task in a play (ad-hoc command is
really is a play of 1 task).

- Tasks that return very quickly might show more variance due to other
factors on the local host.

Thanks for your replies.
Actually I noticed that I write to wrong mailing list. Sorry.
I found an answer here: http://stackoverflow.com/questions/17958949/how-do-i-drive-ansible-programmatically-and-concurrently
and a related discussion here: https://groups.google.com/forum/#!topic/ansible-project/8p3XWlo83ho

Ansible is parallel across hosts, between individual tasks (unless async fire and forget) they run in order.

The v2 code tree may enable some additional capabilities in the future.

Sometimes Ansible not seeing a global known hosts file can make it think it will need to pause to answer a host keying question – newer version of Ansible also read this file and don’t have that problem.

Always always install cowsay :slight_smile: