On Aug 28, 2013, at 9:52 AM, CS <
sapien...@gmail.com> wrote:
>
> Thanks for the response. I thought of using bash `wait` and a script, but I would like to stay in Ansible as much as possible.
>
> My use case is that there are multiple "slow enough" independent tasks that happen on a host, but I can't fire and forget because I need to know that they either succeed or fail. That seems like a pretty common use case, and I have other things too that would benefit from this kind of parallelism, but maybe I'm using Ansible in a non-standard way. In this case, I'm installing N (2 or 3 for now) python virtualenvs for independent services on a single host, each of which takes about 5 minutes to install. I'd love to have developers wait 5 minutes rather than 5N minutes for that part of the installation, and there are other tasks too that nothing else depends on but that need to be reported as succeeding or failing.
>
> Are there any other approaches I might consider using Ansible apart from moving all the parallel tasks into a script?
What I've done to accomplish this is to create fake inventory entries, one entry per action I want to do in parallel. Then I have a play that works over this group of "hosts" to execute the action(s) I want done, all delegated to localhost.