Commit 2bc8c027 by John Jarvis

updating the rolling upgrade example to use the new module

parent e4146b31
...@@ -8,21 +8,20 @@ ...@@ -8,21 +8,20 @@
pre_tasks: pre_tasks:
- name: Gathering ec2 facts - name: Gathering ec2 facts
ec2_facts: ec2_facts:
- name: Gathering ELB facts - name: Removing instance from the ELB
local_action: ec2_elb_facts local_action: ec2_elb
# These two modules "ec2_facts" and "ec2_elb_facts" are invoked in the args:
# pre_tasks and give us the $elbs and $ansible_ec2_isntance_id facts instance_id: "{{ ansible_ec2_instance_id }}"
# which are variables that can be used in the playbook state: 'absent'
- local_action: command util/elb_reg.py -e {{ ",".join(elbs[ansible_ec2_instance_id]) }} -i {{ ansible_ec2_instance_id }} deregister
# -e is the list of elbs that the current instances belong to and -i is
# the instance "active_elbs" are the elbs that are passed in.
roles: roles:
- common - common
- nginx - nginx
- lms - lms
# - ruby - ruby
post_tasks: post_tasks:
- local_action: command util/elb_reg.py -e {{ ",".join(elbs[ansible_ec2_instance_id]) }} -i {{ ansible_ec2_instance_id }} register - name: Adding instance back to the ELB
# Register will pass in the same elb list and the same instance id local_action: ec2_elb
# to add it back to the pool args:
instance_id: "{{ ansible_ec2_instance_id }}"
ec2_elbs: "{{ ec2_elbs }}"
state: 'present'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment