Hi !

I need a suggestion from you to solve a problem I'm facing, here it is...

The problem:
I have a ElasticSearch cluster composed of 6 nodes. During the non work
hours I would like to substitute 4 of those 6 ec2 instance for a different
server (cheaper instance). The main problem is: How can I proceed to the
next server , and remove it from the cluster, since I must wait for the
cluster to get in the "green state" ?

Below you can see how I stop the instances:

    - name: Stopping ES
      ec2:
        instance_ids: "{{ item }}"
        region: sa-east-1
        state: stopped
        wait: True
      with_items: es_ids
      tags:
        - esi_stop

and how I run the cluster health check:

    - name: Checking ES Cluster Status
      uri:
        url=http://<cluster_address>:9200/_cluster/health?pretty
        method=GET
        status_code=200
      register: cluster_status
      until: "'{{ cluster_status.json.status }}' == 'green'"
      retries: 5
      delay: 30
      tags:
        - check_cluster_status

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKz6g-3R8jXnwCOtJNWwbr6iq%3DA%2BbwtqBvBdGYw74Gw4%3D49M4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to