elasticsearch.yml 1.12 KB
Newer Older
1
- hosts: all
2
  become: True
3 4 5 6 7 8 9
  vars:
    # By default take instances in and out of the elb(s) they
    # are attached to
    # To skip elb operations use "-e elb_pre_post=fase"
    elb_pre_post: true
    # Number of instances to operate on at a time
    serial_count: 1
10
    CLUSTER_NAME: "commoncluster"
11 12 13 14
  serial: "{{ serial_count }}"
  pre_tasks:
    - action: ec2_facts
      when: elb_pre_post
15 16
    - debug:
        var: ansible_ec2_instance_id
17 18
      when: elb_pre_post
    - name: Instance De-register
19
      local_action: ec2_elb
20 21 22 23
      args:
        instance_id: "{{ ansible_ec2_instance_id }}"
        region: us-east-1
        state: absent
24
        wait_timeout: 60
25
      become: False
26
      when: elb_pre_post
27
  roles:
e0d committed
28
    - common
29
    - aws
30
    - elasticsearch
31
  post_tasks:
32 33
    - debug:
        var: ansible_ec2_instance_id
34 35
      when: elb_pre_post
    - name: Register instance in the elb
36
      local_action: ec2_elb
37 38
      args:
        instance_id: "{{ ansible_ec2_instance_id }}"
39
        ec2_elbs: "{{ ec2_elbs }}"
40 41
        region: us-east-1
        state: present
42
        wait_timeout: 60
43
      become: False
44
      when: elb_pre_post