> ELASTICSEARCH_INDEX    

        Allow to create ES indices in an idempotent way.

OPTIONS (= is mandatory):

- ca_bundle_file
        Useful if elasticsearch connection is using SSL. Allow to
        specify a CA_BUNDLE file, a file that contains root and
        intermediate certificates to validate the server certificate.
        In its simplest case, it could be a file containing the server
        certificate in .pem format.
        This file will be looked up on the remote system, on which this
        module will be executed.
        [Default: None]

= definition
        Index definition as a json string or as a YAML definition
        [Default: None]

= elasticsearch_url
        The Elasticsearch server base URL to access API. Typically
        http://elastic1.myserver.com:9200
        [Default: None]

= name
        Index name
        [Default: None]

- password
        The password associated with the username
        [Default: None]

- state
        Whether to create (present) or remove (absent) this index. Also
        accept 'get' value, which return index definition
        (Choices: present, absent, get)[Default: present]

- username
        The user name to log on the elasticsearch cluster. Must have
        enough rights to create indices
        [Default: None]

- validate_certs
        Useful if elasticsearch connection is using SSL. If no, SSL
        certificates will not be validated. This should only be used on
        personally controlled sites using self-signed certificates.
        [Default: True]


NOTES:
      * All operations are performed using elasticsearch REST API

AUTHOR: Serge ALEXANDRE

EXAMPLES:
- hosts: elastic1
  roles:
  - elastic_modules
  tasks:
  - name: Create index
    elasticsearch_index:
      name: index1
      elasticsearch_url: "http://elastic1.mydomain.com:9200"
      definition: |
        {
            "settings" : {
                "index": {
                    "number_of_shards" : 1
                }
            },
            "mappings" : {
                "type1" : {
                    "properties" : {
                        "field1" : { "type" : "text" }
                    }
                }
            }
        }
      state: present

# One can also use a pure YAML notation. 

  - name: Create index
    elasticsearch_index:
      name: test1
      elasticsearch_url: "http://elastic1.mydomain.com:9200"
      definition:
        settings:
          index:
            number_of_shards: 1
        mappings:
          type1:
            properties:
              field1:
                type: text
      state: present

