Skip to content

Instantly share code, notes, and snippets.

@chicagobuss
Last active February 23, 2016 15:53
Show Gist options
  • Save chicagobuss/497c11ba8ab26e0a96e2 to your computer and use it in GitHub Desktop.
Save chicagobuss/497c11ba8ab26e0a96e2 to your computer and use it in GitHub Desktop.
parallelized gce launch role
---
# file: roles/launch/tasks/main.yml
- name: Launch instances
local_action: gce instance_names={{ names }} machine_type={{ type }}
image={{ image }} network={{ network }} tags={{ tags }}
register: gce_instances
async: 7200
poll: 0
- name: Wait for instance creation to complete
async_status: jid={{ item.ansible_job_id }}
register: gce_jobs
until: gce_jobs.finished
retries: 300
with_items: gce_instances.results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment