# ansible-playbook -v --user=ubuntu  edxapp_rolling_example.yml -i ./ec2.py  --private-key=/path/to/deployment.pem 

- hosts: tag_Group_anothermulti
  serial: 2
  vars_files:
    - "{{ secure_dir }}/vars/edxapp_stage_vars.yml"
    - "{{ secure_dir }}/vars/users.yml"
  pre_tasks:
    - name: Gathering ec2 facts 
      ec2_facts: 
    - name: Removing instance from the ELB
      local_action: ec2_elb
      args:
        instance_id: "{{ ansible_ec2_instance_id }}"
        state: 'absent'
  roles:
    - common
    - nginx 
    - lms
    - ruby
  post_tasks:
    - name: Adding instance back to the ELB
      local_action: ec2_elb
      args:
        instance_id: "{{ ansible_ec2_instance_id }}"
        ec2_elbs: "{{ ec2_elbs }}"
        state: 'present'