Parallel execution of local actions with multiple items

27 views
Skip to first unread message

Baraa Basata

unread,
Jun 25, 2015, 11:08:33 PM6/25/15
to ansible...@googlegroups.com
Given a need to launch multiple cloud resources via local action, such as the below, is there a way to parallelize the execution of the task?

I think I'm looking for something like `--forks <n>`, except this is different in that there is only one host (localhost) involved in the play.

---
- hosts: localhost
  connection: local
  tasks:
    - local_action:
        module: rds
        name: "{{ item.name }}"
        ...
      with_items: rds_instances


Brian Coca

unread,
Jun 26, 2015, 9:21:30 AM6/26/15
to ansible...@googlegroups.com
that is not currently a feature.




--
Brian Coca

Baraa Basata

unread,
Jun 26, 2015, 11:44:34 AM6/26/15
to ansible...@googlegroups.com
Thanks for confirming, Brian.

After more thought, I've decided to invoke the rds module with "wait: no" (the default value) and then add a task to poll until all newly spun-up instances are in the "available" state before performing other operations on them.

-Baraa
Reply all
Reply to author
Forward
0 new messages