Coder Social home page Coder Social logo

ansible-elasticsearch's Introduction

Stouts.elasticsearch

Build Status Galaxy

Ansible role for manage Elasticsearch

  • Install and configure Elasticsearch;
  • Install/remove Elasticsearch plugins;
  • Setup Nginx as proxy to Elasticseach;
  • Setup HTTP Authorization;

Dependencies

The roles are recomended to install:

Variables

Here is the list of all variables and their default values:

elasticsearch_enabled: yes                      # The role is enabled
elasticsearch_version: 1.1.1                    # Elasticsearch version
elasticsearch_download_url: https://download.elasticsearch.org/elasticsearch/elasticsearch
elasticsearch_apt_repos:
- 'ppa:webupd8team/java'
elasticsearch_apt_repo_keys: []                 # Install APT keys
                                                # Ex. elasticsearch_apt_repo_keys:
                                                #       - server: <server name>
                                                #         key: <key id>
elasticsearch_apt_java_package: oracle-java7-installer

elasticsearch_user: elasticsearch               # Elasticsearch user
elasticsearch_group: elasticsearch              # Elasticsearch group

elasticsearch_home: /usr/share/elasticsearch
elasticsearch_confdir: /etc/elasticsearch
elasticsearch_datadir: /var/lib/elasticsearch
elasticsearch_workdir: /tmp/elasticsearch
elasticsearch_logdir: /var/log/elasticsearch

elasticsearch_plugindir: "{{elasticsearch_home}}/plugins"
elasticsearch_plugins: []                       # Manage elasticsearch plugins (install/remove)
                                                # Ex. elasticsearch_plugins:
                                                #       - name: <plugin name>
                                                #         url: <optional plugin url>
                                                #         dir: <optional plugin dir>
                                                #         remove: yes # Optional the plugin will be removed

# Options
elasticsearch_network_host: 127.0.0.1           # Listen the host
elasticsearch_http_port: 9200                   # Listen the port fot HTTP traffic
elasticsearch_http_cors_enabled: yes            # Enable CORS
elasticsearch_http_cors_allow_origin: "*"       # Set allowed origins
elasticsearch_http_cors_allow_methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
elasticsearch_max_open_files: 65535
elasticsearch_gateway_type: local
elasticsearch_script_disable_dynamic: yes

# Setup a proxy
elasticsearch_proxy: no                           # Enable nginx as elasticsearch proxy
elasticsearch_proxy_hostname:                     # Listen a hostname (leave empty for skip)
elasticsearch_proxy_port: 80                      # Listen a port
elasticsearch_proxy_auth: no                      # Enable HTTP Auth
elasticsearch_proxy_auth_users: []                # Setup users for HTTP Auth. Example:
                                                  # elasticsearch_proxy_auth_users:
                                                  # - { name: username, password: userpassword }

Additional variables could be defined, see Elasticsearch documentation about:

elasticsearch_bootstrap_mlockall:
elasticsearch_cluster_name:
elasticsearch_gateway_expected_nodes:
elasticsearch_gateway_recover_after_nodes:
elasticsearch_gateway_recover_after_time:
elasticsearch_heap_size:
elasticsearch_http_enabled:
elasticsearch_http_max_content_length:
elasticsearch_index_mapper_dynamic:
elasticsearch_index_number_of_replicas:
elasticsearch_index_number_of_shards:
elasticsearch_index_query_bool_max_clause_count:
elasticsearch_indices_cache_filter_size:
elasticsearch_java_opts:
elasticsearch_max_locked_memory:
elasticsearch_network_bind_host:
elasticsearch_network_publish_host:
elasticsearch_node_data:
elasticsearch_node_master:
elasticsearch_node_max_local_storage_nodes:
elasticsearch_node_name:
elasticsearch_node_rack:
elasticsearch_plugin_mandatory:
elasticsearch_recovery_concurrent_streams:
elasticsearch_recovery_max_size_per_sec:
elasticsearch_recovery_node_concurrent_recoveries:
elasticsearch_recovery_node_initial_primaries_recoveries:
elasticsearch_script_disable_dynamic
elasticsearch_script_groovy_sandbox_enabled
elasticsearch_transport_tcp_compress:
elasticsearch_transport_tcp_port:
elasticsearch_use_gc_logging:

Additional variables eg. for plugins can be defined with elasticsearch_yml:

elasticsearch_yml: |
  cloud.aws.access_key: {{ cloud_aws_access_key }}
  cloud.aws.secret_key: {{ cloud_aws_secret_key }}

elasticsearch_yml will be appended to the end of elasticsearch.yml file.

Usage

Add Stouts.elasticsearch to your roles and setup the variables in your playbook file. Example:

- hosts: all

  roles:
    - Stouts.elasticsearch

  vars:
    elasticsearch_plugins:
    - name: lukas-vlcek/bigdesk

Refer to here for more information.

License

Licensed under the MIT License. See the LICENSE file for details.

Feedback, bug-reports, requests, ...

Are welcome!

If you wish to express your appreciation for the role, you are welcome to send a postcard to:

Kirill Klenov
pos. Severny 8-3
MO, Istra, 143500
Russia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.