Skip to content

Instantly share code, notes, and snippets.

@squamous
Created April 17, 2017 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save squamous/b7ae04df6778bf511bbcdfb12fd0448a to your computer and use it in GitHub Desktop.
Save squamous/b7ae04df6778bf511bbcdfb12fd0448a to your computer and use it in GitHub Desktop.
Parallel ansible execution
# http://toroid.org/ansible-parallel-dispatch
- name: Set up EC2 instances
ec2:
...
wait: yes
with_items: instances
register: ec2_instances
async: 7200
poll: 0
- name: Wait for instance creation to complete
async_status: jid={{ item.ansible_job_id }}
register: ec2_jobs
until: ec2_jobs.finished
retries: 300
with_items: ec2_instances.results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment