Skip to content

Instantly share code, notes, and snippets.

@martinheidegger
Created April 17, 2014 16:07
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 martinheidegger/c023f6152d867176095f to your computer and use it in GitHub Desktop.
Save martinheidegger/c023f6152d867176095f to your computer and use it in GitHub Desktop.
- hosts: localhost
connection: local
gather_facts: False
when: has_elb == True
roles:
- ec2-setup-new-instances
- hosts: localhost
connection: local
gather_facts: False
when: has_elb == False
tasks:
- name: Add existing hosts to target instances
add_host: hostname={{ item.public_ip }} groupname=target_instances
with_items: groups.tag_Name_{{ domainTag }}
- hosts: target_instances
sudo: False
roles:
- common
- td-agent
- nodes
- hosts: localhost
sudo: False
when: has_elb == True
roles:
- elb-register-target-instances
- hosts: localhost
when: has_elb == True
sudo: False
roles:
- elb-deregister-old-instances
- hosts: tag_Name_{{ domainTag }}:!tag_Version_{{version}}
when: has_elb == True
roles:
- shutdown-nodes
- hosts: localhost
when: has_elb == True
sudo: False
roles:
- ec2-remove-old-instances
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment