Skip to content

Instantly share code, notes, and snippets.

@omgjlk
Created March 17, 2013 15:19
Show Gist options
  • Save omgjlk/5181985 to your computer and use it in GitHub Desktop.
Save omgjlk/5181985 to your computer and use it in GitHub Desktop.
Ansible playbook help
---
- name: launch instances
local_action: inova env=$supernova_endpoint
name=${hostname}${item}.${cell_domain} image=$image_id
flavor=$flavor wait=$wait
with_sequence: ${count}:%02d
register: inova
Another file:
- name: Boot Instances
hosts: localhost
connection: local
gather_facts: false
tags:
- remoteconfig
vars_files:
- "vars/$region.yml"
- "vars/common.yml"
# Do it once to get all of them launched without waiting, then do it again to
# actually wait and register
tasks:
- include: tasks/launch_instance.yml hostname=${cell_services.$item.hostname}
count=${cell_services.$item.count}
flavor=${cell_services.$item.flavor} wait=no register=throw
with_items: ${cell_services}
- include: tasks/launch_instance.yml hostname=${cell_services.$item.hostname}
count=${cell_services.$item.count}
flavor=${cell_services.$item.flavor} wait=yes register=inova
with_items: ${cell_services}
- name: Add new instances to host group
local_action: add_host hostname=${item.accessIPv4} groupname=deploy
with_items: ${inova.instances}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment