edxapp_rolling_example.yml 758 Bytes
Newer Older
1 2
# ansible-playbook -v --user=ubuntu  edxapp_rolling_example.yml -i ./ec2.py  --private-key=/path/to/deployment.pem 

3
- hosts: tag_Group_anothermulti
4
  serial: 2
5
  vars_files:
6 7
    - "{{ secure_dir }}/vars/edxapp_stage_vars.yml"
    - "{{ secure_dir }}/vars/users.yml"
8 9 10
  pre_tasks:
    - name: Gathering ec2 facts 
      ec2_facts: 
11 12 13 14 15
    - name: Removing instance from the ELB
      local_action: ec2_elb
      args:
        instance_id: "{{ ansible_ec2_instance_id }}"
        state: 'absent'
16 17 18 19
  roles:
    - common
    - nginx 
    - lms
20
    - ruby
21
  post_tasks:
22 23 24 25 26 27
    - name: Adding instance back to the ELB
      local_action: ec2_elb
      args:
        instance_id: "{{ ansible_ec2_instance_id }}"
        ec2_elbs: "{{ ec2_elbs }}"
        state: 'present'