Commit 0fec6229 by jarv

Merge pull request #14 from edx/jarv/rolling-clarifications

change module->library, update the example playbook
parents f5f06275 d431e23f
# ansible-playbook -v --user=ubuntu edxapp_rolling_example.yml -i ./ec2.py --private-key=/path/to/deployment.pem --module-path /path/to/repo/modules # ansible-playbook -v --user=ubuntu edxapp_rolling_example.yml -i ./ec2.py --private-key=/path/to/deployment.pem
- hosts: tag_Group_anothermulti - hosts: tag_Group_anothermulti
serial: 1 serial: 1
vars_files: vars_files:
...@@ -10,10 +11,18 @@ ...@@ -10,10 +11,18 @@
ec2_facts: ec2_facts:
- name: Gathering ELB facts - name: Gathering ELB facts
local_action: ec2_elb_facts local_action: ec2_elb_facts
# These two modules "ec2_facts" and "ec2_elb_facts" are invoked in the
# pre_tasks and give us the $elbs and $ansible_ec2_isntance_id facts
# which are variables that can be used in the playbook
- local_action: command util/elb_reg.py -e {{ ",".join(elbs[ansible_ec2_instance_id]) }} -i {{ ansible_ec2_instance_id }} deregister - 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
post_tasks: post_tasks:
- local_action: command util/elb_reg.py -e {{ ",".join(elbs[ansible_ec2_instance_id]) }} -i {{ ansible_ec2_instance_id }} register - local_action: command util/elb_reg.py -e {{ ",".join(elbs[ansible_ec2_instance_id]) }} -i {{ ansible_ec2_instance_id }} register
# Register will pass in the same elb list and the same instance id
# to add it back to the pool
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