diff --git a/manala.apt/CHANGELOG.md b/manala.apt/CHANGELOG.md index 537373305..54c9ae627 100644 --- a/manala.apt/CHANGELOG.md +++ b/manala.apt/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Added - Backports sloppy support +- Elasticsearch 5 support + +### Fixed +- Elasticsearch repositories patterns source urls +- Elasticsearch keys patterns urls ## [1.0.5] - 2017-10-09 ### Added diff --git a/manala.apt/vars/main.yml b/manala.apt/vars/main.yml index 55702570f..19a5a2cbc 100644 --- a/manala.apt/vars/main.yml +++ b/manala.apt/vars/main.yml @@ -185,16 +185,19 @@ manala_apt_repositories_patterns: source: deb https://packagecloud.io/grafana/stable/debian/ wheezy main key: packagecloud elasticsearch_1_5: - source: deb http://packages.elastic.co/elasticsearch/1.5/debian stable main + source: deb https://packages.elastic.co/elasticsearch/1.5/debian stable main key: elasticsearch elasticsearch_1_6: - source: deb http://packages.elastic.co/elasticsearch/1.6/debian stable main + source: deb https://packages.elastic.co/elasticsearch/1.6/debian stable main key: elasticsearch elasticsearch_1_7: - source: deb http://packages.elastic.co/elasticsearch/1.7/debian stable main + source: deb https://packages.elastic.co/elasticsearch/1.7/debian stable main key: elasticsearch elasticsearch_2: - source: deb http://packages.elastic.co/elasticsearch/2.x/debian stable main + source: deb https://packages.elastic.co/elasticsearch/2.x/debian stable main + key: elasticsearch + elasticsearch_5: + source: deb https://artifacts.elastic.co/packages/5.x/apt stable main key: elasticsearch ansible: "{{ { @@ -311,7 +314,7 @@ manala_apt_keys_patterns: url: https://packagecloud.io/gpg.key id: D59097AB elasticsearch: - url: https://packages.elastic.co/GPG-KEY-elasticsearch + url: https://artifacts.elastic.co/GPG-KEY-elasticsearch id: D88E42B4 gitlab: url: https://packages.gitlab.com/gpg.key diff --git a/manala.elasticsearch/CHANGELOG.md b/manala.elasticsearch/CHANGELOG.md index efc662a67..bae8bf499 100644 --- a/manala.elasticsearch/CHANGELOG.md +++ b/manala.elasticsearch/CHANGELOG.md @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Added +- Handle version (autodetect or fixed) +- Version based configurations +- Version based / distribution release requirements +- Version based tests +- Support version 5 ## [1.0.0] - 2017-06-21 ### Added diff --git a/manala.elasticsearch/defaults/main.yml b/manala.elasticsearch/defaults/main.yml index 53f9554b0..aa62b6f52 100644 --- a/manala.elasticsearch/defaults/main.yml +++ b/manala.elasticsearch/defaults/main.yml @@ -1,6 +1,7 @@ --- -manala_elasticsearch_dir: /usr/share/elasticsearch +# Elasticsearch version. Available values are '~' (autodetect), '1.5', '1.6', '1.7', '2', '5' +manala_elasticsearch_version: ~ # Config manala_elasticsearch_config_file: /etc/elasticsearch/elasticsearch.yml diff --git a/manala.elasticsearch/tasks/install.yml b/manala.elasticsearch/tasks/install.yml index 31122519a..a8c7af4fe 100644 --- a/manala.elasticsearch/tasks/install.yml +++ b/manala.elasticsearch/tasks/install.yml @@ -9,3 +9,21 @@ cache_valid_time: 3600 with_items: - elasticsearch + +- name: install > Version + shell: "dpkg -s elasticsearch | grep \"Version: \" | sed -e 's/Version: //g'" + register: __manala_elasticsearch_version + when: not manala_elasticsearch_version + check_mode: false + changed_when: false + +- name: install > Version + set_fact: + manala_elasticsearch_version: "{{ + __manala_elasticsearch_version.stdout.split('.')[0] ~ '.' ~ __manala_elasticsearch_version.stdout.split('.')[1] + if (__manala_elasticsearch_version.stdout|version_compare('2.0.0', '<')) else + __manala_elasticsearch_version.stdout.split('.')[0] + }}" + when: not manala_elasticsearch_version + check_mode: false + changed_when: false diff --git a/manala.elasticsearch/tasks/requirements.yml b/manala.elasticsearch/tasks/requirements.yml index ec09e7cb9..800478057 100644 --- a/manala.elasticsearch/tasks/requirements.yml +++ b/manala.elasticsearch/tasks/requirements.yml @@ -11,3 +11,12 @@ fail: msg: Need java, you can use https://github.com/manala/ansible-role-java when: __manala_java_check_output.stdout is not defined + +- name: requirements > Version + fail: + msg: Your "manala_elasticsearch_version" is not compatible with your release + when: + - manala_elasticsearch_version != None + - manala_elasticsearch_version|version_compare('5.0.0', '>=') + and ansible_distribution_release == 'wheezy' + check_mode: false diff --git a/manala.elasticsearch/templates/config/1.5/_base.j2 b/manala.elasticsearch/templates/config/1.5/_base.j2 new file mode 100644 index 000000000..ae0aeea53 --- /dev/null +++ b/manala.elasticsearch/templates/config/1.5/_base.j2 @@ -0,0 +1,445 @@ +{%- import '_macros.j2' as macros with context -%} + +{% set config = manala_elasticsearch_config -%} + +##################### Elasticsearch Configuration Example ##################### + +# This file contains an overview of various configuration settings, +# targeted at operations staff. Application developers should +# consult the guide at . +# +# The installation procedure is covered at +# . +# +# Elasticsearch comes with reasonable defaults for most settings, +# so you can try it out without bothering with configuration. +# +# Most of the time, these defaults are just fine for running a production +# cluster. If you're fine-tuning your cluster, or wondering about the +# effect of certain configuration option, please _do ask_ on the +# mailing list or IRC channel [http://elasticsearch.org/community]. + +# Any element in the configuration can be replaced with environment variables +# by placing them in ${...} notation. For example: +# +#node.rack: ${RACK_ENV_VAR} + +# For information on supported formats and syntax for the config file, see +# + + +################################### Cluster ################################### + +# Cluster name identifies your cluster for auto-discovery. If you're running +# multiple clusters on the same network, make sure you're using unique names. +# +{{ macros.config_row(config, 'cluster.name', '#cluster.name: elasticsearch', 0, true) }} + + +#################################### Node ##################################### + +# Node names are generated dynamically on startup, so you're relieved +# from configuring them manually. You can tie this node to a specific name: +# +{{ macros.config_row(config, 'node.name', '#node.name: "Franz Kafka"', 0, true) }} + +# Every node can be configured to allow or deny being eligible as the master, +# and to allow or deny to store the data. +# +# Allow this node to be eligible as a master node (enabled by default): +# +{{ macros.config_row(config, 'node.master', '#node.master: true', 0, true) }} +# +# Allow this node to store data (enabled by default): +# +{{ macros.config_row(config, 'node.data', '#node.data: true', 0, true) }} + +# You can exploit these settings to design advanced cluster topologies. +# +# 1. You want this node to never become a master node, only to hold data. +# This will be the "workhorse" of your cluster. +# +#node.master: false +#node.data: true +# +# 2. You want this node to only serve as a master: to not store any data and +# to have free resources. This will be the "coordinator" of your cluster. +# +#node.master: true +#node.data: false +# +# 3. You want this node to be neither master nor data node, but +# to act as a "search load balancer" (fetching data from nodes, +# aggregating results, etc.) +# +#node.master: false +#node.data: false + +# Use the Cluster Health API [http://localhost:9200/_cluster/health], the +# Node Info API [http://localhost:9200/_nodes] or GUI tools +# such as , +# , +# and +# to inspect the cluster state. + +# A node can have generic attributes associated with it, which can later be used +# for customized shard allocation filtering, or allocation awareness. An attribute +# is a simple key value pair, similar to node.key: value, here is an example: +# +#node.rack: rack314 + +# By default, multiple nodes are allowed to start from the same installation location +# to disable it, set the following: +{{ macros.config_row(config, 'node.max_local_storage_nodes', '#node.max_local_storage_nodes: 1', 0, true) }} + + +#################################### Index #################################### + +# You can set a number of options (such as shard/replica options, mapping +# or analyzer definitions, translog settings, ...) for indices globally, +# in this file. +# +# Note, that it makes more sense to configure index settings specifically for +# a certain index, either when creating it or by using the index templates API. +# +# See and +# +# for more information. + +# Set the number of shards (splits) of an index (5 by default): +# +{{ macros.config_row(config, 'index.number_of_shards', '#index.number_of_shards: 5', 0, true) }} + +# Set the number of replicas (additional copies) of an index (1 by default): +# +{{ macros.config_row(config, 'index.number_of_replicas', '#index.number_of_replicas: 1', 0, true) }} + +# Note, that for development on a local machine, with small indices, it usually +# makes sense to "disable" the distributed features: +# +#index.number_of_shards: 1 +#index.number_of_replicas: 0 + +# These settings directly affect the performance of index and search operations +# in your cluster. Assuming you have enough machines to hold shards and +# replicas, the rule of thumb is: +# +# 1. Having more *shards* enhances the _indexing_ performance and allows to +# _distribute_ a big index across machines. +# 2. Having more *replicas* enhances the _search_ performance and improves the +# cluster _availability_. +# +# The "number_of_shards" is a one-time setting for an index. +# +# The "number_of_replicas" can be increased or decreased anytime, +# by using the Index Update Settings API. +# +# Elasticsearch takes care about load balancing, relocating, gathering the +# results from nodes, etc. Experiment with different settings to fine-tune +# your setup. + +# Use the Index Status API () to inspect +# the index status. + + +#################################### Paths #################################### + +# Path to directory containing configuration (this file and logging.yml): +# +{{ macros.config_row(config, 'path.conf', '#path.conf: /path/to/conf', 0, true) }} + +# Path to directory where to store index data allocated for this node. +# +{{ macros.config_row(config, 'path.data', '#path.data: /path/to/data', 0, true) }} +# +# Can optionally include more than one location, causing data to be striped across +# the locations (a la RAID 0) on a file level, favouring locations with most free +# space on creation. For example: +# +#path.data: /path/to/data1,/path/to/data2 + +# Path to temporary files: +# +{{ macros.config_row(config, 'path.work', '#path.work: /path/to/work', 0, true) }} + +# Path to log files: +# +{{ macros.config_row(config, 'path.logs', '#path.logs: /path/to/logs', 0, true) }} + +# Path to where plugins are installed: +# +{{ macros.config_row(config, 'path.plugins', '#path.plugins: /path/to/plugins', 0, true) }} + + +#################################### Plugin ################################### + +# If a plugin listed here is not installed for current node, the node will not start. +# +{{ macros.config_row(config, 'plugin.mandatory', '#plugin.mandatory: mapper-attachments,lang-groovy', 0, true) }} + + +################################### Memory #################################### + +# Elasticsearch performs poorly when JVM starts swapping: you should ensure that +# it _never_ swaps. +# +# Set this property to true to lock the memory: +# +{{ macros.config_row(config, 'bootstrap.mlockall', '#bootstrap.mlockall: true', 0, true) }} + +# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set +# to the same value, and that the machine has enough memory to allocate +# for Elasticsearch, leaving enough memory for the operating system itself. +# +# You should also make sure that the Elasticsearch process is allowed to lock +# the memory, eg. by using `ulimit -l unlimited`. + + +############################## Network And HTTP ############################### + +# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens +# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node +# communication. (the range means that if the port is busy, it will automatically +# try the next port). + +# Set the bind address specifically (IPv4 or IPv6): +# +{{ macros.config_row(config, 'network.bind_host', '#network.bind_host: 192.168.0.1', 0, true) }} + +# Set the address other nodes will use to communicate with this node. If not +# set, it is automatically derived. It must point to an actual IP address. +# +{{ macros.config_row(config, 'network.publish_host', '#network.publish_host: 192.168.0.1', 0, true) }} + +# Set both 'bind_host' and 'publish_host': +# +{{ macros.config_row(config, 'network.host', '#network.host: 192.168.0.1', 0, true) }} + +# Set a custom port for the node to node communication (9300 by default): +# +{{ macros.config_row(config, 'transport.tcp.port', '#transport.tcp.port: 9300', 0, true) }} + +# Enable compression for all communication between nodes (disabled by default): +# +{{ macros.config_row(config, 'transport.tcp.compress', '#transport.tcp.compress: true', 0, true) }} + +# Set a custom port to listen for HTTP traffic: +# +{{ macros.config_row(config, 'http.port', '#http.port: 9200', 0, true) }} + +# Set a custom allowed content length: +# +{{ macros.config_row(config, 'http.max_content_length', '#http.max_content_length: 100mb', 0, true) }} + +# Disable HTTP completely: +# +{{ macros.config_row(config, 'http.enabled', '#http.enabled: false', 0, true) }} + + +################################### Gateway ################################### + +# The gateway allows for persisting the cluster state between full cluster +# restarts. Every change to the state (such as adding an index) will be stored +# in the gateway, and when the cluster starts up for the first time, +# it will read its state from the gateway. + +# There are several types of gateway implementations. For more information, see +# . + +# The default gateway type is the "local" gateway (recommended): +# +{{ macros.config_row(config, 'gateway.type', '#gateway.type: local', 0, true) }} + +# Settings below control how and when to start the initial recovery process on +# a full cluster restart (to reuse as much local data as possible when using shared +# gateway). + +# Allow recovery process after N nodes in a cluster are up: +# +{{ macros.config_row(config, 'gateway.recover_after_nodes', '#gateway.recover_after_nodes: 1', 0, true) }} + +# Set the timeout to initiate the recovery process, once the N nodes +# from previous setting are up (accepts time value): +# +{{ macros.config_row(config, 'gateway.recover_after_time', '#gateway.recover_after_time: 5m', 0, true) }} + +# Set how many nodes are expected in this cluster. Once these N nodes +# are up (and recover_after_nodes is met), begin recovery process immediately +# (without waiting for recover_after_time to expire): +# +{{ macros.config_row(config, 'gateway.expected_nodes', '#gateway.expected_nodes: 2', 0, true) }} + + +############################# Recovery Throttling ############################# + +# These settings allow to control the process of shards allocation between +# nodes during initial recovery, replica allocation, rebalancing, +# or when adding and removing nodes. + +# Set the number of concurrent recoveries happening on a node: +# +# 1. During the initial recovery +# +{{ macros.config_row(config, 'cluster.routing.allocation.node_initial_primaries_recoveries', '#cluster.routing.allocation.node_initial_primaries_recoveries: 4', 0, true) }} +# +# 2. During adding/removing nodes, rebalancing, etc +# +{{ macros.config_row(config, 'cluster.routing.allocation.node_concurrent_recoveries', '#cluster.routing.allocation.node_concurrent_recoveries: 2', 0, true) }} + +# Set to throttle throughput when recovering (eg. 100mb, by default 20mb): +# +{{ macros.config_row(config, 'indices.recovery.max_bytes_per_sec', '#indices.recovery.max_bytes_per_sec: 20mb', 0, true) }} + +# Set to limit the number of open concurrent streams when +# recovering a shard from a peer: +# +{{ macros.config_row(config, 'indices.recovery.concurrent_streams', '#indices.recovery.concurrent_streams: 5', 0, true) }} + + +################################## Discovery ################################## + +# Discovery infrastructure ensures nodes can be found within a cluster +# and master node is elected. Multicast discovery is the default. + +# Set to ensure a node sees N other master eligible nodes to be considered +# operational within the cluster. This should be set to a quorum/majority of +# the master-eligible nodes in the cluster. +# +{{ macros.config_row(config, 'discovery.zen.minimum_master_nodes', '#discovery.zen.minimum_master_nodes: 1', 0, true) }} + +# Set the time to wait for ping responses from other nodes when discovering. +# Set this option to a higher value on a slow or congested network +# to minimize discovery failures: +# +{{ macros.config_row(config, 'discovery.zen.ping.timeout', '#discovery.zen.ping.timeout: 3s', 0, true) }} + +# For more information, see +# + +# Unicast discovery allows to explicitly control which nodes will be used +# to discover the cluster. It can be used when multicast is not present, +# or to restrict the cluster communication-wise. +# +# 1. Disable multicast discovery (enabled by default): +# +{{ macros.config_row(config, 'discovery.zen.ping.multicast.enabled', '#discovery.zen.ping.multicast.enabled: false', 0, true) }} +# +# 2. Configure an initial list of master nodes in the cluster +# to perform discovery when new nodes (master or data) are started: +# +{{ macros.config_row(config, 'discovery.zen.ping.unicast.hosts', '#discovery.zen.ping.unicast.hosts: ["host1", "host2:port"]', 0, true) }} + +# EC2 discovery allows to use AWS EC2 API in order to perform discovery. +# +# You have to install the cloud-aws plugin for enabling the EC2 discovery. +# +# For more information, see +# +# +# See +# for a step-by-step tutorial. + +# GCE discovery allows to use Google Compute Engine API in order to perform discovery. +# +# You have to install the cloud-gce plugin for enabling the GCE discovery. +# +# For more information, see . + +# Azure discovery allows to use Azure API in order to perform discovery. +# +# You have to install the cloud-azure plugin for enabling the Azure discovery. +# +# For more information, see . + +################################## Slow Log ################################## + +# Shard level query and fetch threshold logging. + +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.warn', '#index.search.slowlog.threshold.query.warn: 10s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.info', '#index.search.slowlog.threshold.query.info: 5s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.debug', '#index.search.slowlog.threshold.query.debug: 2s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.trace', '#index.search.slowlog.threshold.query.trace: 500ms', 0, true) }} + +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.warn', '#index.search.slowlog.threshold.fetch.warn: 1s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.info', '#index.search.slowlog.threshold.fetch.info: 800ms', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.debug', '#index.search.slowlog.threshold.fetch.debug: 500ms', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.trace', '#index.search.slowlog.threshold.fetch.trace: 200ms', 0, true) }} + +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.warn', '#index.indexing.slowlog.threshold.index.warn: 10s', 0, true) }} +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.info', '#index.indexing.slowlog.threshold.index.info: 5s', 0, true) }} +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.debug', '#index.indexing.slowlog.threshold.index.debug: 2s', 0, true) }} +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.trace', '#index.indexing.slowlog.threshold.index.trace: 500ms', 0, true) }} + +################################## GC Logging ################################ + +{{ macros.config_row(config, 'monitor.jvm.gc.young.warn', '#monitor.jvm.gc.young.warn: 1000ms', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.info', '#monitor.jvm.gc.young.info: 700ms', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.debug', '#monitor.jvm.gc.young.debug: 400ms', 0, true) }} + +{{ macros.config_row(config, 'monitor.jvm.gc.young.warn', '#monitor.jvm.gc.old.warn: 10s', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.info', '#monitor.jvm.gc.old.info: 5s', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.debug', '#monitor.jvm.gc.old.debug: 2s', 0, true) }} + +################################## Security ################################ + +# Uncomment if you want to enable JSONP as a valid return transport on the +# http server. With this enabled, it may pose a security risk, so disabling +# it unless you need it is recommended (it is disabled by default). +# +{{ macros.config_row(config, 'http.jsonp.enable', '#http.jsonp.enable: true', 0, true) }} + +{{ macros.config(config, [ + 'cluster.name', + 'node.name', + 'node.master', + 'node.data', + 'node.max_local_storage_nodes', + 'index.number_of_shards', + 'index.number_of_replicas', + 'path.conf', + 'path.data', + 'path.work', + 'path.logs', + 'path.plugins', + 'plugin.mandatory', + 'bootstrap.mlockall', + 'network.bind_host', + 'network.publish_host', + 'network.host', + 'transport.tcp.port', + 'transport.tcp.compress', + 'http.port', + 'http.max_content_length', + 'http.enabled', + 'gateway.type', + 'gateway.recover_after_nodes', + 'gateway.recover_after_time', + 'gateway.expected_nodes', + 'cluster.routing.allocation.node_initial_primaries_recoveries', + 'cluster.routing.allocation.node_concurrent_recoveries', + 'indices.recovery.max_bytes_per_sec', + 'indices.recovery.concurrent_streams', + 'discovery.zen.minimum_master_nodes', + 'discovery.zen.ping.timeout', + 'discovery.zen.ping.multicast.enabled', + 'discovery.zen.ping.unicast.hosts', + 'index.search.slowlog.threshold.query.warn', + 'index.search.slowlog.threshold.query.info', + 'index.search.slowlog.threshold.query.debug', + 'index.search.slowlog.threshold.query.trace', + 'index.search.slowlog.threshold.fetch.warn', + 'index.search.slowlog.threshold.fetch.info', + 'index.search.slowlog.threshold.fetch.debug', + 'index.search.slowlog.threshold.fetch.trace', + 'index.indexing.slowlog.threshold.index.warn', + 'index.indexing.slowlog.threshold.index.info', + 'index.indexing.slowlog.threshold.index.debug', + 'index.indexing.slowlog.threshold.index.trace', + 'monitor.jvm.gc.young.warn', + 'monitor.jvm.gc.young.info', + 'monitor.jvm.gc.young.debug', + 'monitor.jvm.gc.old.warn', + 'monitor.jvm.gc.old.info', + 'monitor.jvm.gc.old.debug', + 'http.jsonp.enable' +]) -}} diff --git a/manala.elasticsearch/templates/config/1.5/default.j2 b/manala.elasticsearch/templates/config/1.5/default.j2 new file mode 100644 index 000000000..9a189b952 --- /dev/null +++ b/manala.elasticsearch/templates/config/1.5/default.j2 @@ -0,0 +1 @@ +{% include '1.5/_base.j2' %} diff --git a/manala.elasticsearch/templates/config/1.6/_base.j2 b/manala.elasticsearch/templates/config/1.6/_base.j2 new file mode 100644 index 000000000..ae0aeea53 --- /dev/null +++ b/manala.elasticsearch/templates/config/1.6/_base.j2 @@ -0,0 +1,445 @@ +{%- import '_macros.j2' as macros with context -%} + +{% set config = manala_elasticsearch_config -%} + +##################### Elasticsearch Configuration Example ##################### + +# This file contains an overview of various configuration settings, +# targeted at operations staff. Application developers should +# consult the guide at . +# +# The installation procedure is covered at +# . +# +# Elasticsearch comes with reasonable defaults for most settings, +# so you can try it out without bothering with configuration. +# +# Most of the time, these defaults are just fine for running a production +# cluster. If you're fine-tuning your cluster, or wondering about the +# effect of certain configuration option, please _do ask_ on the +# mailing list or IRC channel [http://elasticsearch.org/community]. + +# Any element in the configuration can be replaced with environment variables +# by placing them in ${...} notation. For example: +# +#node.rack: ${RACK_ENV_VAR} + +# For information on supported formats and syntax for the config file, see +# + + +################################### Cluster ################################### + +# Cluster name identifies your cluster for auto-discovery. If you're running +# multiple clusters on the same network, make sure you're using unique names. +# +{{ macros.config_row(config, 'cluster.name', '#cluster.name: elasticsearch', 0, true) }} + + +#################################### Node ##################################### + +# Node names are generated dynamically on startup, so you're relieved +# from configuring them manually. You can tie this node to a specific name: +# +{{ macros.config_row(config, 'node.name', '#node.name: "Franz Kafka"', 0, true) }} + +# Every node can be configured to allow or deny being eligible as the master, +# and to allow or deny to store the data. +# +# Allow this node to be eligible as a master node (enabled by default): +# +{{ macros.config_row(config, 'node.master', '#node.master: true', 0, true) }} +# +# Allow this node to store data (enabled by default): +# +{{ macros.config_row(config, 'node.data', '#node.data: true', 0, true) }} + +# You can exploit these settings to design advanced cluster topologies. +# +# 1. You want this node to never become a master node, only to hold data. +# This will be the "workhorse" of your cluster. +# +#node.master: false +#node.data: true +# +# 2. You want this node to only serve as a master: to not store any data and +# to have free resources. This will be the "coordinator" of your cluster. +# +#node.master: true +#node.data: false +# +# 3. You want this node to be neither master nor data node, but +# to act as a "search load balancer" (fetching data from nodes, +# aggregating results, etc.) +# +#node.master: false +#node.data: false + +# Use the Cluster Health API [http://localhost:9200/_cluster/health], the +# Node Info API [http://localhost:9200/_nodes] or GUI tools +# such as , +# , +# and +# to inspect the cluster state. + +# A node can have generic attributes associated with it, which can later be used +# for customized shard allocation filtering, or allocation awareness. An attribute +# is a simple key value pair, similar to node.key: value, here is an example: +# +#node.rack: rack314 + +# By default, multiple nodes are allowed to start from the same installation location +# to disable it, set the following: +{{ macros.config_row(config, 'node.max_local_storage_nodes', '#node.max_local_storage_nodes: 1', 0, true) }} + + +#################################### Index #################################### + +# You can set a number of options (such as shard/replica options, mapping +# or analyzer definitions, translog settings, ...) for indices globally, +# in this file. +# +# Note, that it makes more sense to configure index settings specifically for +# a certain index, either when creating it or by using the index templates API. +# +# See and +# +# for more information. + +# Set the number of shards (splits) of an index (5 by default): +# +{{ macros.config_row(config, 'index.number_of_shards', '#index.number_of_shards: 5', 0, true) }} + +# Set the number of replicas (additional copies) of an index (1 by default): +# +{{ macros.config_row(config, 'index.number_of_replicas', '#index.number_of_replicas: 1', 0, true) }} + +# Note, that for development on a local machine, with small indices, it usually +# makes sense to "disable" the distributed features: +# +#index.number_of_shards: 1 +#index.number_of_replicas: 0 + +# These settings directly affect the performance of index and search operations +# in your cluster. Assuming you have enough machines to hold shards and +# replicas, the rule of thumb is: +# +# 1. Having more *shards* enhances the _indexing_ performance and allows to +# _distribute_ a big index across machines. +# 2. Having more *replicas* enhances the _search_ performance and improves the +# cluster _availability_. +# +# The "number_of_shards" is a one-time setting for an index. +# +# The "number_of_replicas" can be increased or decreased anytime, +# by using the Index Update Settings API. +# +# Elasticsearch takes care about load balancing, relocating, gathering the +# results from nodes, etc. Experiment with different settings to fine-tune +# your setup. + +# Use the Index Status API () to inspect +# the index status. + + +#################################### Paths #################################### + +# Path to directory containing configuration (this file and logging.yml): +# +{{ macros.config_row(config, 'path.conf', '#path.conf: /path/to/conf', 0, true) }} + +# Path to directory where to store index data allocated for this node. +# +{{ macros.config_row(config, 'path.data', '#path.data: /path/to/data', 0, true) }} +# +# Can optionally include more than one location, causing data to be striped across +# the locations (a la RAID 0) on a file level, favouring locations with most free +# space on creation. For example: +# +#path.data: /path/to/data1,/path/to/data2 + +# Path to temporary files: +# +{{ macros.config_row(config, 'path.work', '#path.work: /path/to/work', 0, true) }} + +# Path to log files: +# +{{ macros.config_row(config, 'path.logs', '#path.logs: /path/to/logs', 0, true) }} + +# Path to where plugins are installed: +# +{{ macros.config_row(config, 'path.plugins', '#path.plugins: /path/to/plugins', 0, true) }} + + +#################################### Plugin ################################### + +# If a plugin listed here is not installed for current node, the node will not start. +# +{{ macros.config_row(config, 'plugin.mandatory', '#plugin.mandatory: mapper-attachments,lang-groovy', 0, true) }} + + +################################### Memory #################################### + +# Elasticsearch performs poorly when JVM starts swapping: you should ensure that +# it _never_ swaps. +# +# Set this property to true to lock the memory: +# +{{ macros.config_row(config, 'bootstrap.mlockall', '#bootstrap.mlockall: true', 0, true) }} + +# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set +# to the same value, and that the machine has enough memory to allocate +# for Elasticsearch, leaving enough memory for the operating system itself. +# +# You should also make sure that the Elasticsearch process is allowed to lock +# the memory, eg. by using `ulimit -l unlimited`. + + +############################## Network And HTTP ############################### + +# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens +# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node +# communication. (the range means that if the port is busy, it will automatically +# try the next port). + +# Set the bind address specifically (IPv4 or IPv6): +# +{{ macros.config_row(config, 'network.bind_host', '#network.bind_host: 192.168.0.1', 0, true) }} + +# Set the address other nodes will use to communicate with this node. If not +# set, it is automatically derived. It must point to an actual IP address. +# +{{ macros.config_row(config, 'network.publish_host', '#network.publish_host: 192.168.0.1', 0, true) }} + +# Set both 'bind_host' and 'publish_host': +# +{{ macros.config_row(config, 'network.host', '#network.host: 192.168.0.1', 0, true) }} + +# Set a custom port for the node to node communication (9300 by default): +# +{{ macros.config_row(config, 'transport.tcp.port', '#transport.tcp.port: 9300', 0, true) }} + +# Enable compression for all communication between nodes (disabled by default): +# +{{ macros.config_row(config, 'transport.tcp.compress', '#transport.tcp.compress: true', 0, true) }} + +# Set a custom port to listen for HTTP traffic: +# +{{ macros.config_row(config, 'http.port', '#http.port: 9200', 0, true) }} + +# Set a custom allowed content length: +# +{{ macros.config_row(config, 'http.max_content_length', '#http.max_content_length: 100mb', 0, true) }} + +# Disable HTTP completely: +# +{{ macros.config_row(config, 'http.enabled', '#http.enabled: false', 0, true) }} + + +################################### Gateway ################################### + +# The gateway allows for persisting the cluster state between full cluster +# restarts. Every change to the state (such as adding an index) will be stored +# in the gateway, and when the cluster starts up for the first time, +# it will read its state from the gateway. + +# There are several types of gateway implementations. For more information, see +# . + +# The default gateway type is the "local" gateway (recommended): +# +{{ macros.config_row(config, 'gateway.type', '#gateway.type: local', 0, true) }} + +# Settings below control how and when to start the initial recovery process on +# a full cluster restart (to reuse as much local data as possible when using shared +# gateway). + +# Allow recovery process after N nodes in a cluster are up: +# +{{ macros.config_row(config, 'gateway.recover_after_nodes', '#gateway.recover_after_nodes: 1', 0, true) }} + +# Set the timeout to initiate the recovery process, once the N nodes +# from previous setting are up (accepts time value): +# +{{ macros.config_row(config, 'gateway.recover_after_time', '#gateway.recover_after_time: 5m', 0, true) }} + +# Set how many nodes are expected in this cluster. Once these N nodes +# are up (and recover_after_nodes is met), begin recovery process immediately +# (without waiting for recover_after_time to expire): +# +{{ macros.config_row(config, 'gateway.expected_nodes', '#gateway.expected_nodes: 2', 0, true) }} + + +############################# Recovery Throttling ############################# + +# These settings allow to control the process of shards allocation between +# nodes during initial recovery, replica allocation, rebalancing, +# or when adding and removing nodes. + +# Set the number of concurrent recoveries happening on a node: +# +# 1. During the initial recovery +# +{{ macros.config_row(config, 'cluster.routing.allocation.node_initial_primaries_recoveries', '#cluster.routing.allocation.node_initial_primaries_recoveries: 4', 0, true) }} +# +# 2. During adding/removing nodes, rebalancing, etc +# +{{ macros.config_row(config, 'cluster.routing.allocation.node_concurrent_recoveries', '#cluster.routing.allocation.node_concurrent_recoveries: 2', 0, true) }} + +# Set to throttle throughput when recovering (eg. 100mb, by default 20mb): +# +{{ macros.config_row(config, 'indices.recovery.max_bytes_per_sec', '#indices.recovery.max_bytes_per_sec: 20mb', 0, true) }} + +# Set to limit the number of open concurrent streams when +# recovering a shard from a peer: +# +{{ macros.config_row(config, 'indices.recovery.concurrent_streams', '#indices.recovery.concurrent_streams: 5', 0, true) }} + + +################################## Discovery ################################## + +# Discovery infrastructure ensures nodes can be found within a cluster +# and master node is elected. Multicast discovery is the default. + +# Set to ensure a node sees N other master eligible nodes to be considered +# operational within the cluster. This should be set to a quorum/majority of +# the master-eligible nodes in the cluster. +# +{{ macros.config_row(config, 'discovery.zen.minimum_master_nodes', '#discovery.zen.minimum_master_nodes: 1', 0, true) }} + +# Set the time to wait for ping responses from other nodes when discovering. +# Set this option to a higher value on a slow or congested network +# to minimize discovery failures: +# +{{ macros.config_row(config, 'discovery.zen.ping.timeout', '#discovery.zen.ping.timeout: 3s', 0, true) }} + +# For more information, see +# + +# Unicast discovery allows to explicitly control which nodes will be used +# to discover the cluster. It can be used when multicast is not present, +# or to restrict the cluster communication-wise. +# +# 1. Disable multicast discovery (enabled by default): +# +{{ macros.config_row(config, 'discovery.zen.ping.multicast.enabled', '#discovery.zen.ping.multicast.enabled: false', 0, true) }} +# +# 2. Configure an initial list of master nodes in the cluster +# to perform discovery when new nodes (master or data) are started: +# +{{ macros.config_row(config, 'discovery.zen.ping.unicast.hosts', '#discovery.zen.ping.unicast.hosts: ["host1", "host2:port"]', 0, true) }} + +# EC2 discovery allows to use AWS EC2 API in order to perform discovery. +# +# You have to install the cloud-aws plugin for enabling the EC2 discovery. +# +# For more information, see +# +# +# See +# for a step-by-step tutorial. + +# GCE discovery allows to use Google Compute Engine API in order to perform discovery. +# +# You have to install the cloud-gce plugin for enabling the GCE discovery. +# +# For more information, see . + +# Azure discovery allows to use Azure API in order to perform discovery. +# +# You have to install the cloud-azure plugin for enabling the Azure discovery. +# +# For more information, see . + +################################## Slow Log ################################## + +# Shard level query and fetch threshold logging. + +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.warn', '#index.search.slowlog.threshold.query.warn: 10s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.info', '#index.search.slowlog.threshold.query.info: 5s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.debug', '#index.search.slowlog.threshold.query.debug: 2s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.trace', '#index.search.slowlog.threshold.query.trace: 500ms', 0, true) }} + +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.warn', '#index.search.slowlog.threshold.fetch.warn: 1s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.info', '#index.search.slowlog.threshold.fetch.info: 800ms', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.debug', '#index.search.slowlog.threshold.fetch.debug: 500ms', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.trace', '#index.search.slowlog.threshold.fetch.trace: 200ms', 0, true) }} + +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.warn', '#index.indexing.slowlog.threshold.index.warn: 10s', 0, true) }} +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.info', '#index.indexing.slowlog.threshold.index.info: 5s', 0, true) }} +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.debug', '#index.indexing.slowlog.threshold.index.debug: 2s', 0, true) }} +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.trace', '#index.indexing.slowlog.threshold.index.trace: 500ms', 0, true) }} + +################################## GC Logging ################################ + +{{ macros.config_row(config, 'monitor.jvm.gc.young.warn', '#monitor.jvm.gc.young.warn: 1000ms', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.info', '#monitor.jvm.gc.young.info: 700ms', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.debug', '#monitor.jvm.gc.young.debug: 400ms', 0, true) }} + +{{ macros.config_row(config, 'monitor.jvm.gc.young.warn', '#monitor.jvm.gc.old.warn: 10s', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.info', '#monitor.jvm.gc.old.info: 5s', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.debug', '#monitor.jvm.gc.old.debug: 2s', 0, true) }} + +################################## Security ################################ + +# Uncomment if you want to enable JSONP as a valid return transport on the +# http server. With this enabled, it may pose a security risk, so disabling +# it unless you need it is recommended (it is disabled by default). +# +{{ macros.config_row(config, 'http.jsonp.enable', '#http.jsonp.enable: true', 0, true) }} + +{{ macros.config(config, [ + 'cluster.name', + 'node.name', + 'node.master', + 'node.data', + 'node.max_local_storage_nodes', + 'index.number_of_shards', + 'index.number_of_replicas', + 'path.conf', + 'path.data', + 'path.work', + 'path.logs', + 'path.plugins', + 'plugin.mandatory', + 'bootstrap.mlockall', + 'network.bind_host', + 'network.publish_host', + 'network.host', + 'transport.tcp.port', + 'transport.tcp.compress', + 'http.port', + 'http.max_content_length', + 'http.enabled', + 'gateway.type', + 'gateway.recover_after_nodes', + 'gateway.recover_after_time', + 'gateway.expected_nodes', + 'cluster.routing.allocation.node_initial_primaries_recoveries', + 'cluster.routing.allocation.node_concurrent_recoveries', + 'indices.recovery.max_bytes_per_sec', + 'indices.recovery.concurrent_streams', + 'discovery.zen.minimum_master_nodes', + 'discovery.zen.ping.timeout', + 'discovery.zen.ping.multicast.enabled', + 'discovery.zen.ping.unicast.hosts', + 'index.search.slowlog.threshold.query.warn', + 'index.search.slowlog.threshold.query.info', + 'index.search.slowlog.threshold.query.debug', + 'index.search.slowlog.threshold.query.trace', + 'index.search.slowlog.threshold.fetch.warn', + 'index.search.slowlog.threshold.fetch.info', + 'index.search.slowlog.threshold.fetch.debug', + 'index.search.slowlog.threshold.fetch.trace', + 'index.indexing.slowlog.threshold.index.warn', + 'index.indexing.slowlog.threshold.index.info', + 'index.indexing.slowlog.threshold.index.debug', + 'index.indexing.slowlog.threshold.index.trace', + 'monitor.jvm.gc.young.warn', + 'monitor.jvm.gc.young.info', + 'monitor.jvm.gc.young.debug', + 'monitor.jvm.gc.old.warn', + 'monitor.jvm.gc.old.info', + 'monitor.jvm.gc.old.debug', + 'http.jsonp.enable' +]) -}} diff --git a/manala.elasticsearch/templates/config/1.6/default.j2 b/manala.elasticsearch/templates/config/1.6/default.j2 new file mode 100644 index 000000000..6ab9bc585 --- /dev/null +++ b/manala.elasticsearch/templates/config/1.6/default.j2 @@ -0,0 +1 @@ +{% include '1.6/_base.j2' %} diff --git a/manala.elasticsearch/templates/config/1.7/_base.j2 b/manala.elasticsearch/templates/config/1.7/_base.j2 new file mode 100644 index 000000000..456e0dd9d --- /dev/null +++ b/manala.elasticsearch/templates/config/1.7/_base.j2 @@ -0,0 +1,445 @@ +{%- import '_macros.j2' as macros with context -%} + +{% set config = manala_elasticsearch_config -%} + +##################### Elasticsearch Configuration Example ##################### + +# This file contains an overview of various configuration settings, +# targeted at operations staff. Application developers should +# consult the guide at . +# +# The installation procedure is covered at +# . +# +# Elasticsearch comes with reasonable defaults for most settings, +# so you can try it out without bothering with configuration. +# +# Most of the time, these defaults are just fine for running a production +# cluster. If you're fine-tuning your cluster, or wondering about the +# effect of certain configuration option, please _do ask_ on the +# mailing list or IRC channel [http://elasticsearch.org/community]. + +# Any element in the configuration can be replaced with environment variables +# by placing them in ${...} notation. For example: +# +#node.rack: ${RACK_ENV_VAR} + +# For information on supported formats and syntax for the config file, see +# + + +################################### Cluster ################################### + +# Cluster name identifies your cluster for auto-discovery. If you're running +# multiple clusters on the same network, make sure you're using unique names. +# +{{ macros.config_row(config, 'cluster.name', '#cluster.name: elasticsearch', 0, true) }} + + +#################################### Node ##################################### + +# Node names are generated dynamically on startup, so you're relieved +# from configuring them manually. You can tie this node to a specific name: +# +{{ macros.config_row(config, 'node.name', '#node.name: "Franz Kafka"', 0, true) }} + +# Every node can be configured to allow or deny being eligible as the master, +# and to allow or deny to store the data. +# +# Allow this node to be eligible as a master node (enabled by default): +# +{{ macros.config_row(config, 'node.master', '#node.master: true', 0, true) }} +# +# Allow this node to store data (enabled by default): +# +{{ macros.config_row(config, 'node.data', '#node.data: true', 0, true) }} + +# You can exploit these settings to design advanced cluster topologies. +# +# 1. You want this node to never become a master node, only to hold data. +# This will be the "workhorse" of your cluster. +# +#node.master: false +#node.data: true +# +# 2. You want this node to only serve as a master: to not store any data and +# to have free resources. This will be the "coordinator" of your cluster. +# +#node.master: true +#node.data: false +# +# 3. You want this node to be neither master nor data node, but +# to act as a "search load balancer" (fetching data from nodes, +# aggregating results, etc.) +# +#node.master: false +#node.data: false + +# Use the Cluster Health API [http://localhost:9200/_cluster/health], the +# Node Info API [http://localhost:9200/_nodes] or GUI tools +# such as , +# , +# and +# to inspect the cluster state. + +# A node can have generic attributes associated with it, which can later be used +# for customized shard allocation filtering, or allocation awareness. An attribute +# is a simple key value pair, similar to node.key: value, here is an example: +# +#node.rack: rack314 + +# By default, multiple nodes are allowed to start from the same installation location +# to disable it, set the following: +{{ macros.config_row(config, 'node.max_local_storage_nodes', '#node.max_local_storage_nodes: 1', 0, true) }} + + +#################################### Index #################################### + +# You can set a number of options (such as shard/replica options, mapping +# or analyzer definitions, translog settings, ...) for indices globally, +# in this file. +# +# Note, that it makes more sense to configure index settings specifically for +# a certain index, either when creating it or by using the index templates API. +# +# See and +# +# for more information. + +# Set the number of shards (splits) of an index (5 by default): +# +{{ macros.config_row(config, 'index.number_of_shards', '#index.number_of_shards: 5', 0, true) }} + +# Set the number of replicas (additional copies) of an index (1 by default): +# +{{ macros.config_row(config, 'index.number_of_replicas', '#index.number_of_replicas: 1', 0, true) }} + +# Note, that for development on a local machine, with small indices, it usually +# makes sense to "disable" the distributed features: +# +#index.number_of_shards: 1 +#index.number_of_replicas: 0 + +# These settings directly affect the performance of index and search operations +# in your cluster. Assuming you have enough machines to hold shards and +# replicas, the rule of thumb is: +# +# 1. Having more *shards* enhances the _indexing_ performance and allows to +# _distribute_ a big index across machines. +# 2. Having more *replicas* enhances the _search_ performance and improves the +# cluster _availability_. +# +# The "number_of_shards" is a one-time setting for an index. +# +# The "number_of_replicas" can be increased or decreased anytime, +# by using the Index Update Settings API. +# +# Elasticsearch takes care about load balancing, relocating, gathering the +# results from nodes, etc. Experiment with different settings to fine-tune +# your setup. + +# Use the Index Status API () to inspect +# the index status. + + +#################################### Paths #################################### + +# Path to directory containing configuration (this file and logging.yml): +# +{{ macros.config_row(config, 'path.conf', '#path.conf: /path/to/conf', 0, true) }} + +# Path to directory where to store index data allocated for this node. +# +{{ macros.config_row(config, 'path.data', '#path.data: /path/to/data', 0, true) }} +# +# Can optionally include more than one location, causing data to be striped across +# the locations (a la RAID 0) on a file level, favouring locations with most free +# space on creation. For example: +# +#path.data: /path/to/data1,/path/to/data2 + +# Path to temporary files: +# +{{ macros.config_row(config, 'path.work', '#path.work: /path/to/work', 0, true) }} + +# Path to log files: +# +{{ macros.config_row(config, 'path.logs', '#path.logs: /path/to/logs', 0, true) }} + +# Path to where plugins are installed: +# +{{ macros.config_row(config, 'path.plugins', '#path.plugins: /path/to/plugins', 0, true) }} + + +#################################### Plugin ################################### + +# If a plugin listed here is not installed for current node, the node will not start. +# +{{ macros.config_row(config, 'plugin.mandatory', '#plugin.mandatory: mapper-attachments,lang-groovy', 0, true) }} + + +################################### Memory #################################### + +# Elasticsearch performs poorly when JVM starts swapping: you should ensure that +# it _never_ swaps. +# +# Set this property to true to lock the memory: +# +{{ macros.config_row(config, 'bootstrap.mlockall', '#bootstrap.mlockall: true', 0, true) }} + +# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set +# to the same value, and that the machine has enough memory to allocate +# for Elasticsearch, leaving enough memory for the operating system itself. +# +# You should also make sure that the Elasticsearch process is allowed to lock +# the memory, eg. by using `ulimit -l unlimited`. + + +############################## Network And HTTP ############################### + +# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens +# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node +# communication. (the range means that if the port is busy, it will automatically +# try the next port). + +# Set the bind address specifically (IPv4 or IPv6): +# +{{ macros.config_row(config, 'network.bind_host', '#network.bind_host: 192.168.0.1', 0, true) }} + +# Set the address other nodes will use to communicate with this node. If not +# set, it is automatically derived. It must point to an actual IP address. +# +{{ macros.config_row(config, 'network.publish_host', '#network.publish_host: 192.168.0.1', 0, true) }} + +# Set both 'bind_host' and 'publish_host': +# +{{ macros.config_row(config, 'network.host', '#network.host: 192.168.0.1', 0, true) }} + +# Set a custom port for the node to node communication (9300 by default): +# +{{ macros.config_row(config, 'transport.tcp.port', '#transport.tcp.port: 9300', 0, true) }} + +# Enable compression for all communication between nodes (disabled by default): +# +{{ macros.config_row(config, 'transport.tcp.compress', '#transport.tcp.compress: true', 0, true) }} + +# Set a custom port to listen for HTTP traffic: +# +{{ macros.config_row(config, 'http.port', '#http.port: 9200', 0, true) }} + +# Set a custom allowed content length: +# +{{ macros.config_row(config, 'http.max_content_length', '#http.max_content_length: 100mb', 0, true) }} + +# Disable HTTP completely: +# +{{ macros.config_row(config, 'http.enabled', '#http.enabled: false', 0, true) }} + + +################################### Gateway ################################### + +# The gateway allows for persisting the cluster state between full cluster +# restarts. Every change to the state (such as adding an index) will be stored +# in the gateway, and when the cluster starts up for the first time, +# it will read its state from the gateway. + +# There are several types of gateway implementations. For more information, see +# . + +# The default gateway type is the "local" gateway (recommended): +# +{{ macros.config_row(config, 'gateway.type', '#gateway.type: local', 0, true) }} + +# Settings below control how and when to start the initial recovery process on +# a full cluster restart (to reuse as much local data as possible when using shared +# gateway). + +# Allow recovery process after N nodes in a cluster are up: +# +{{ macros.config_row(config, 'gateway.recover_after_nodes', '#gateway.recover_after_nodes: 1', 0, true) }} + +# Set the timeout to initiate the recovery process, once the N nodes +# from previous setting are up (accepts time value): +# +{{ macros.config_row(config, 'gateway.recover_after_time', '#gateway.recover_after_time: 5m', 0, true) }} + +# Set how many nodes are expected in this cluster. Once these N nodes +# are up (and recover_after_nodes is met), begin recovery process immediately +# (without waiting for recover_after_time to expire): +# +{{ macros.config_row(config, 'gateway.expected_nodes', '#gateway.expected_nodes: 2', 0, true) }} + + +############################# Recovery Throttling ############################# + +# These settings allow to control the process of shards allocation between +# nodes during initial recovery, replica allocation, rebalancing, +# or when adding and removing nodes. + +# Set the number of concurrent recoveries happening on a node: +# +# 1. During the initial recovery +# +{{ macros.config_row(config, 'cluster.routing.allocation.node_initial_primaries_recoveries', '#cluster.routing.allocation.node_initial_primaries_recoveries: 4', 0, true) }} +# +# 2. During adding/removing nodes, rebalancing, etc +# +{{ macros.config_row(config, 'cluster.routing.allocation.node_concurrent_recoveries', '#cluster.routing.allocation.node_concurrent_recoveries: 2', 0, true) }} + +# Set to throttle throughput when recovering (eg. 100mb, by default 20mb): +# +{{ macros.config_row(config, 'indices.recovery.max_bytes_per_sec', '#indices.recovery.max_bytes_per_sec: 20mb', 0, true) }} + +# Set to limit the number of open concurrent streams when +# recovering a shard from a peer: +# +{{ macros.config_row(config, 'indices.recovery.concurrent_streams', '#indices.recovery.concurrent_streams: 5', 0, true) }} + + +################################## Discovery ################################## + +# Discovery infrastructure ensures nodes can be found within a cluster +# and master node is elected. Multicast discovery is the default. + +# Set to ensure a node sees N other master eligible nodes to be considered +# operational within the cluster. This should be set to a quorum/majority of +# the master-eligible nodes in the cluster. +# +{{ macros.config_row(config, 'discovery.zen.minimum_master_nodes', '#discovery.zen.minimum_master_nodes: 1', 0, true) }} + +# Set the time to wait for ping responses from other nodes when discovering. +# Set this option to a higher value on a slow or congested network +# to minimize discovery failures: +# +{{ macros.config_row(config, 'discovery.zen.ping.timeout', '#discovery.zen.ping.timeout: 3s', 0, true) }} + +# For more information, see +# + +# Unicast discovery allows to explicitly control which nodes will be used +# to discover the cluster. It can be used when multicast is not present, +# or to restrict the cluster communication-wise. +# +# 1. Disable multicast discovery (enabled by default): +# +{{ macros.config_row(config, 'discovery.zen.ping.multicast.enabled', '#discovery.zen.ping.multicast.enabled: false', 0, true) }} +# +# 2. Configure an initial list of master nodes in the cluster +# to perform discovery when new nodes (master or data) are started: +# +{{ macros.config_row(config, 'discovery.zen.ping.unicast.hosts', '#discovery.zen.ping.unicast.hosts: ["host1", "host2:port"]', 0, true) }} + +# EC2 discovery allows to use AWS EC2 API in order to perform discovery. +# +# You have to install the cloud-aws plugin for enabling the EC2 discovery. +# +# For more information, see +# +# +# See +# for a step-by-step tutorial. + +# GCE discovery allows to use Google Compute Engine API in order to perform discovery. +# +# You have to install the cloud-gce plugin for enabling the GCE discovery. +# +# For more information, see . + +# Azure discovery allows to use Azure API in order to perform discovery. +# +# You have to install the cloud-azure plugin for enabling the Azure discovery. +# +# For more information, see . + +################################## Slow Log ################################## + +# Shard level query and fetch threshold logging. + +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.warn', '#index.search.slowlog.threshold.query.warn: 10s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.info', '#index.search.slowlog.threshold.query.info: 5s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.debug', '#index.search.slowlog.threshold.query.debug: 2s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.query.trace', '#index.search.slowlog.threshold.query.trace: 500ms', 0, true) }} + +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.warn', '#index.search.slowlog.threshold.fetch.warn: 1s', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.info', '#index.search.slowlog.threshold.fetch.info: 800ms', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.debug', '#index.search.slowlog.threshold.fetch.debug: 500ms', 0, true) }} +{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.trace', '#index.search.slowlog.threshold.fetch.trace: 200ms', 0, true) }} + +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.warn', '#index.indexing.slowlog.threshold.index.warn: 10s', 0, true) }} +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.info', '#index.indexing.slowlog.threshold.index.info: 5s', 0, true) }} +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.debug', '#index.indexing.slowlog.threshold.index.debug: 2s', 0, true) }} +{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.trace', '#index.indexing.slowlog.threshold.index.trace: 500ms', 0, true) }} + +################################## GC Logging ################################ + +{{ macros.config_row(config, 'monitor.jvm.gc.young.warn', '#monitor.jvm.gc.young.warn: 1000ms', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.info', '#monitor.jvm.gc.young.info: 700ms', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.debug', '#monitor.jvm.gc.young.debug: 400ms', 0, true) }} + +{{ macros.config_row(config, 'monitor.jvm.gc.young.warn', '#monitor.jvm.gc.old.warn: 10s', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.info', '#monitor.jvm.gc.old.info: 5s', 0, true) }} +{{ macros.config_row(config, 'monitor.jvm.gc.young.debug', '#monitor.jvm.gc.old.debug: 2s', 0, true) }} + +################################## Security ################################ + +# Uncomment if you want to enable JSONP as a valid return transport on the +# http server. With this enabled, it may pose a security risk, so disabling +# it unless you need it is recommended (it is disabled by default). +# +{{ macros.config_row(config, 'http.jsonp.enable', '#http.jsonp.enable: true', 0, true) }} + +{{ macros.config(config, [ + 'cluster.name', + 'node.name', + 'node.master', + 'node.data', + 'node.max_local_storage_nodes', + 'index.number_of_shards', + 'index.number_of_replicas', + 'path.conf', + 'path.data', + 'path.work', + 'path.logs', + 'path.plugins', + 'plugin.mandatory', + 'bootstrap.mlockall', + 'network.bind_host', + 'network.publish_host', + 'network.host', + 'transport.tcp.port', + 'transport.tcp.compress', + 'http.port', + 'http.max_content_length', + 'http.enabled', + 'gateway.type', + 'gateway.recover_after_nodes', + 'gateway.recover_after_time', + 'gateway.expected_nodes', + 'cluster.routing.allocation.node_initial_primaries_recoveries', + 'cluster.routing.allocation.node_concurrent_recoveries', + 'indices.recovery.max_bytes_per_sec', + 'indices.recovery.concurrent_streams', + 'discovery.zen.minimum_master_nodes', + 'discovery.zen.ping.timeout', + 'discovery.zen.ping.multicast.enabled', + 'discovery.zen.ping.unicast.hosts', + 'index.search.slowlog.threshold.query.warn', + 'index.search.slowlog.threshold.query.info', + 'index.search.slowlog.threshold.query.debug', + 'index.search.slowlog.threshold.query.trace', + 'index.search.slowlog.threshold.fetch.warn', + 'index.search.slowlog.threshold.fetch.info', + 'index.search.slowlog.threshold.fetch.debug', + 'index.search.slowlog.threshold.fetch.trace', + 'index.indexing.slowlog.threshold.index.warn', + 'index.indexing.slowlog.threshold.index.info', + 'index.indexing.slowlog.threshold.index.debug', + 'index.indexing.slowlog.threshold.index.trace', + 'monitor.jvm.gc.young.warn', + 'monitor.jvm.gc.young.info', + 'monitor.jvm.gc.young.debug', + 'monitor.jvm.gc.old.warn', + 'monitor.jvm.gc.old.info', + 'monitor.jvm.gc.old.debug', + 'http.jsonp.enable' +]) -}} diff --git a/manala.elasticsearch/templates/config/1.7/default.j2 b/manala.elasticsearch/templates/config/1.7/default.j2 new file mode 100644 index 000000000..44ab66ee4 --- /dev/null +++ b/manala.elasticsearch/templates/config/1.7/default.j2 @@ -0,0 +1 @@ +{% include '1.7/_base.j2' %} diff --git a/manala.elasticsearch/templates/config/2/_base.j2 b/manala.elasticsearch/templates/config/2/_base.j2 new file mode 100755 index 000000000..2f53c6e4a --- /dev/null +++ b/manala.elasticsearch/templates/config/2/_base.j2 @@ -0,0 +1,114 @@ +{%- import '_macros.j2' as macros with context -%} + +{% set config = manala_elasticsearch_config -%} + +# ======================== Elasticsearch Configuration ========================= +# +# NOTE: Elasticsearch comes with reasonable defaults for most settings. +# Before you set out to tweak and tune the configuration, make sure you +# understand what are you trying to accomplish and the consequences. +# +# The primary way of configuring a node is via this file. This template lists +# the most important settings you may want to configure for a production cluster. +# +# Please see the documentation for further information on configuration options: +# +# +# ---------------------------------- Cluster ----------------------------------- +# +# Use a descriptive name for your cluster: +# +{{ macros.config_row(config, 'cluster.name', '# cluster.name: my-application', 0, true) }} +# +# ------------------------------------ Node ------------------------------------ +# +# Use a descriptive name for the node: +# +{{ macros.config_row(config, 'node.name', '# node.name: node-1', 0, true) }} +# +# Add custom attributes to the node: +# +{{ macros.config_row(config, 'node.rack', '# node.rack: r1', 0, true) }} +# +# ----------------------------------- Paths ------------------------------------ +# +# Path to directory where to store the data (separate multiple locations by comma): +# +{{ macros.config_row(config, 'path.data', '# path.data: /path/to/data', 0, true) }} +# +# Path to log files: +# +{{ macros.config_row(config, 'path.logs', '# path.logs: /path/to/logs', 0, true) }} +# +# ----------------------------------- Memory ----------------------------------- +# +# Lock the memory on startup: +# +{{ macros.config_row(config, 'bootstrap.memory_lock', '# bootstrap.memory_lock: true', 0, true) }} +# +# Make sure that the `ES_HEAP_SIZE` environment variable is set to about half the memory +# available on the system and that the owner of the process is allowed to use this limit. +# +# Elasticsearch performs poorly when the system is swapping the memory. +# +# ---------------------------------- Network ----------------------------------- +# +# Set the bind address to a specific IP (IPv4 or IPv6): +# +{{ macros.config_row(config, 'network.host', '# network.host: 192.168.0.1', 0, true) }} +# +# Set a custom port for HTTP: +# +{{ macros.config_row(config, 'http.port', '# http.port: 9200', 0, true) }} +# +# For more information, see the documentation at: +# +# +# --------------------------------- Discovery ---------------------------------- +# +# Pass an initial list of hosts to perform discovery when new node is started: +# The default list of hosts is ["127.0.0.1", "[::1]"] +# +{{ macros.config_row(config, 'discovery.zen.ping.unicast.hosts', '# discovery.zen.ping.unicast.hosts: ["host1", "host2"]', 0, true) }} +# +# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1): +# +{{ macros.config_row(config, 'discovery.zen.minimum_master_nodes', '# discovery.zen.minimum_master_nodes: 3', 0, true) }} +# +# For more information, see the documentation at: +# +# +# ---------------------------------- Gateway ----------------------------------- +# +# Block initial recovery after a full cluster restart until N nodes are started: +# +{{ macros.config_row(config, 'gateway.recover_after_nodes', '# gateway.recover_after_nodes: 3', 0, true) }} +# +# For more information, see the documentation at: +# +# +# ---------------------------------- Various ----------------------------------- +# +# Disable starting multiple nodes on a single system: +# +{{ macros.config_row(config, 'node.max_local_storage_nodes', '# node.max_local_storage_nodes: 1', 0, true) }} +# +# Require explicit names when deleting indices: +# +{{ macros.config_row(config, 'action.destructive_requires_name', '# action.destructive_requires_name: true', 0, true) }} + +{{ macros.config(config, [ + 'cluster.name', + 'node.name', + 'node.rack', + 'path.data', + 'path.logs', + 'bootstrap.memory_lock', + 'network.host', + 'http.port', + 'discovery.zen.ping.unicast.hosts', + 'discovery.zen.minimum_master_nodes', + 'gateway.recover_after_nodes', + 'node.max_local_storage_nodes', + 'action.destructive_requires_name' +]) -}} diff --git a/manala.elasticsearch/templates/config/2/default.j2 b/manala.elasticsearch/templates/config/2/default.j2 new file mode 100644 index 000000000..5e20b0d8c --- /dev/null +++ b/manala.elasticsearch/templates/config/2/default.j2 @@ -0,0 +1 @@ +{% include '2/_base.j2' %} diff --git a/manala.elasticsearch/templates/config/5/_base.j2 b/manala.elasticsearch/templates/config/5/_base.j2 new file mode 100644 index 000000000..a9d970cad --- /dev/null +++ b/manala.elasticsearch/templates/config/5/_base.j2 @@ -0,0 +1,107 @@ +{%- import '_macros.j2' as macros with context -%} + +{% set config = manala_elasticsearch_config -%} + +# ======================== Elasticsearch Configuration ========================= +# +# NOTE: Elasticsearch comes with reasonable defaults for most settings. +# Before you set out to tweak and tune the configuration, make sure you +# understand what are you trying to accomplish and the consequences. +# +# The primary way of configuring a node is via this file. This template lists +# the most important settings you may want to configure for a production cluster. +# +# Please consult the documentation for further information on configuration options: +# https://www.elastic.co/guide/en/elasticsearch/reference/index.html +# +# ---------------------------------- Cluster ----------------------------------- +# +# Use a descriptive name for your cluster: +# +{{ macros.config_row(config, 'cluster.name', '#cluster.name: my-application', 0, true) }} +# +# ------------------------------------ Node ------------------------------------ +# +# Use a descriptive name for the node: +# +{{ macros.config_row(config, 'node.name', '#node.name: node-1', 0, true) }} +# +# Add custom attributes to the node: +# +{{ macros.config_row(config, 'node.attr.rack', '#node.attr.rack: r1', 0, true) }} +# +# ----------------------------------- Paths ------------------------------------ +# +# Path to directory where to store the data (separate multiple locations by comma): +# +{{ macros.config_row(config, 'path.data', '#path.data: /path/to/data', 0, true) }} +# +# Path to log files: +# +{{ macros.config_row(config, 'path.logs', '#path.logs: /path/to/logs', 0, true) }} +# +# ----------------------------------- Memory ----------------------------------- +# +# Lock the memory on startup: +# +{{ macros.config_row(config, 'bootstrap.memory_lock', '#bootstrap.memory_lock: true', 0, true) }} +# +# Make sure that the heap size is set to about half the memory available +# on the system and that the owner of the process is allowed to use this +# limit. +# +# Elasticsearch performs poorly when the system is swapping the memory. +# +# ---------------------------------- Network ----------------------------------- +# +# Set the bind address to a specific IP (IPv4 or IPv6): +# +{{ macros.config_row(config, 'network.host', '#network.host: 192.168.0.1', 0, true) }} +# +# Set a custom port for HTTP: +# +{{ macros.config_row(config, 'http.port', '#http.port: 9200', 0, true) }} +# +# For more information, consult the network module documentation. +# +# --------------------------------- Discovery ---------------------------------- +# +# Pass an initial list of hosts to perform discovery when new node is started: +# The default list of hosts is ["127.0.0.1", "[::1]"] +# +{{ macros.config_row(config, 'discovery.zen.ping.unicast.hosts', '#discovery.zen.ping.unicast.hosts: ["host1", "host2"]', 0, true) }} +# +# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1): +# +{{ macros.config_row(config, 'discovery.zen.minimum_master_nodes', '#discovery.zen.minimum_master_nodes: 3', 0, true) }} +# +# For more information, consult the zen discovery module documentation. +# +# ---------------------------------- Gateway ----------------------------------- +# +# Block initial recovery after a full cluster restart until N nodes are started: +# +{{ macros.config_row(config, 'gateway.recover_after_nodes', '#gateway.recover_after_nodes: 3', 0, true) }} +# +# For more information, consult the gateway module documentation. +# +# ---------------------------------- Various ----------------------------------- +# +# Require explicit names when deleting indices: +# +{{ macros.config_row(config, 'action.destructive_requires_name', '#action.destructive_requires_name: true', 0, true) }} + +{{ macros.config(config, [ + 'cluster.name', + 'node.name', + 'node.attr.rack', + 'path.data', + 'path.logs', + 'bootstrap.memory_lock', + 'network.host', + 'http.port', + 'discovery.zen.ping.unicast.hosts', + 'discovery.zen.minimum_master_nodes', + 'gateway.recover_after_nodes', + 'action.destructive_requires_name' +]) -}} diff --git a/manala.elasticsearch/templates/config/5/default.j2 b/manala.elasticsearch/templates/config/5/default.j2 new file mode 100644 index 000000000..0caacce36 --- /dev/null +++ b/manala.elasticsearch/templates/config/5/default.j2 @@ -0,0 +1 @@ +{% include '5/_base.j2' %} diff --git a/manala.elasticsearch/templates/config/_base.j2 b/manala.elasticsearch/templates/config/_base.j2 new file mode 100644 index 000000000..b5cd6c672 --- /dev/null +++ b/manala.elasticsearch/templates/config/_base.j2 @@ -0,0 +1,2 @@ +{%- set template_name = (template_env == '')|ternary('default.j2','default.' ~ template_env ~ '.j2') -%} +{%- include manala_elasticsearch_version|string ~ '/' ~ template_name -%} diff --git a/manala.elasticsearch/templates/config/default.j2 b/manala.elasticsearch/templates/config/default.j2 index c847ca57c..258037a9a 100644 --- a/manala.elasticsearch/templates/config/default.j2 +++ b/manala.elasticsearch/templates/config/default.j2 @@ -1,444 +1,2 @@ -{%- import '_macros.j2' as macros with context -%} - -{% set config = manala_elasticsearch_config -%} - -##################### Elasticsearch Configuration Example ##################### - -# This file contains an overview of various configuration settings, -# targeted at operations staff. Application developers should -# consult the guide at . -# -# The installation procedure is covered at -# . -# -# Elasticsearch comes with reasonable defaults for most settings, -# so you can try it out without bothering with configuration. -# -# Most of the time, these defaults are just fine for running a production -# cluster. If you're fine-tuning your cluster, or wondering about the -# effect of certain configuration option, please _do ask_ on the -# mailing list or IRC channel [http://elasticsearch.org/community]. - -# Any element in the configuration can be replaced with environment variables -# by placing them in ${...} notation. For example: -# -#node.rack: ${RACK_ENV_VAR} - -# For information on supported formats and syntax for the config file, see -# - - -################################### Cluster ################################### - -# Cluster name identifies your cluster for auto-discovery. If you're running -# multiple clusters on the same network, make sure you're using unique names. -# -{{ macros.config_row(config, 'cluster.name', '#cluster.name: elasticsearch', 0, true) }} - - -#################################### Node ##################################### - -# Node names are generated dynamically on startup, so you're relieved -# from configuring them manually. You can tie this node to a specific name: -# -{{ macros.config_row(config, 'node.name', '#node.name: "Franz Kafka"', 0, true) }} - -# Every node can be configured to allow or deny being eligible as the master, -# and to allow or deny to store the data. -# -# Allow this node to be eligible as a master node (enabled by default): -# -{{ macros.config_row(config, 'node.master', '#node.master: true', 0, true) }} -# -# Allow this node to store data (enabled by default): -# -{{ macros.config_row(config, 'node.data', '#node.data: true', 0, true) }} - -# You can exploit these settings to design advanced cluster topologies. -# -# 1. You want this node to never become a master node, only to hold data. -# This will be the "workhorse" of your cluster. -# -#node.master: false -#node.data: true -# -# 2. You want this node to only serve as a master: to not store any data and -# to have free resources. This will be the "coordinator" of your cluster. -# -#node.master: true -#node.data: false -# -# 3. You want this node to be neither master nor data node, but -# to act as a "search load balancer" (fetching data from nodes, -# aggregating results, etc.) -# -#node.master: false -#node.data: false - -# Use the Cluster Health API [http://localhost:9200/_cluster/health], the -# Node Info API [http://localhost:9200/_nodes] or GUI tools -# such as , -# , -# and -# to inspect the cluster state. - -# A node can have generic attributes associated with it, which can later be used -# for customized shard allocation filtering, or allocation awareness. An attribute -# is a simple key value pair, similar to node.key: value, here is an example: -# -#node.rack: rack314 - -# By default, multiple nodes are allowed to start from the same installation location -# to disable it, set the following: -{{ macros.config_row(config, 'node.max_local_storage_nodes', '#node.max_local_storage_nodes: 1', 0, true) }} - - -#################################### Index #################################### - -# You can set a number of options (such as shard/replica options, mapping -# or analyzer definitions, translog settings, ...) for indices globally, -# in this file. -# -# Note, that it makes more sense to configure index settings specifically for -# a certain index, either when creating it or by using the index templates API. -# -# See and -# -# for more information. - -# Set the number of shards (splits) of an index (5 by default): -# -{{ macros.config_row(config, 'index.number_of_shards', '#index.number_of_shards: 5', 0, true) }} - -# Set the number of replicas (additional copies) of an index (1 by default): -# -{{ macros.config_row(config, 'index.number_of_replicas', '#index.number_of_replicas: 1', 0, true) }} - -# Note, that for development on a local machine, with small indices, it usually -# makes sense to "disable" the distributed features: -# -#index.number_of_shards: 1 -#index.number_of_replicas: 0 - -# These settings directly affect the performance of index and search operations -# in your cluster. Assuming you have enough machines to hold shards and -# replicas, the rule of thumb is: -# -# 1. Having more *shards* enhances the _indexing_ performance and allows to -# _distribute_ a big index across machines. -# 2. Having more *replicas* enhances the _search_ performance and improves the -# cluster _availability_. -# -# The "number_of_shards" is a one-time setting for an index. -# -# The "number_of_replicas" can be increased or decreased anytime, -# by using the Index Update Settings API. -# -# Elasticsearch takes care about load balancing, relocating, gathering the -# results from nodes, etc. Experiment with different settings to fine-tune -# your setup. - -# Use the Index Status API () to inspect -# the index status. - - -#################################### Paths #################################### - -# Path to directory containing configuration (this file and logging.yml): -# -{{ macros.config_row(config, 'path.conf', '#path.conf: /path/to/conf', 0, true) }} - -# Path to directory where to store index data allocated for this node. -# -{{ macros.config_row(config, 'path.data', '#path.data: /path/to/data', 0, true) }} -# -# Can optionally include more than one location, causing data to be striped across -# the locations (a la RAID 0) on a file level, favouring locations with most free -# space on creation. For example: -# -#path.data: /path/to/data1,/path/to/data2 - -# Path to temporary files: -# -{{ macros.config_row(config, 'path.work', '#path.work: /path/to/work', 0, true) }} - -# Path to log files: -# -{{ macros.config_row(config, 'path.logs', '#path.logs: /path/to/logs', 0, true) }} - -# Path to where plugins are installed: -# -{{ macros.config_row(config, 'path.plugins', '#path.plugins: /path/to/plugins', 0, true) }} - - -#################################### Plugin ################################### - -# If a plugin listed here is not installed for current node, the node will not start. -# -{{ macros.config_row(config, 'plugin.mandatory', '#plugin.mandatory: mapper-attachments,lang-groovy', 0, true) }} - - -################################### Memory #################################### - -# Elasticsearch performs poorly when JVM starts swapping: you should ensure that -# it _never_ swaps. -# -# Set this property to true to lock the memory: -# -{{ macros.config_row(config, 'bootstrap.mlockall', '#bootstrap.mlockall: true', 0, true) }} - -# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set -# to the same value, and that the machine has enough memory to allocate -# for Elasticsearch, leaving enough memory for the operating system itself. -# -# You should also make sure that the Elasticsearch process is allowed to lock -# the memory, eg. by using `ulimit -l unlimited`. - - -############################## Network And HTTP ############################### - -# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens -# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node -# communication. (the range means that if the port is busy, it will automatically -# try the next port). - -# Set the bind address specifically (IPv4 or IPv6): -# -{{ macros.config_row(config, 'network.bind_host', '#network.bind_host: 192.168.0.1', 0, true) }} - -# Set the address other nodes will use to communicate with this node. If not -# set, it is automatically derived. It must point to an actual IP address. -# -{{ macros.config_row(config, 'network.publish_host', '#network.publish_host: 192.168.0.1', 0, true) }} - -# Set both 'bind_host' and 'publish_host': -# -{{ macros.config_row(config, 'network.host', '#network.host: 192.168.0.1', 0, true) }} - -# Set a custom port for the node to node communication (9300 by default): -# -{{ macros.config_row(config, 'transport.tcp.port', '#transport.tcp.port: 9300', 0, true) }} - -# Enable compression for all communication between nodes (disabled by default): -# -{{ macros.config_row(config, 'transport.tcp.compress', '#transport.tcp.compress: true', 0, true) }} - -# Set a custom port to listen for HTTP traffic: -# -{{ macros.config_row(config, 'http.port', '#http.port: 9200', 0, true) }} - -# Set a custom allowed content length: -# -{{ macros.config_row(config, 'http.max_content_length', '#http.max_content_length: 100mb', 0, true) }} - -# Disable HTTP completely: -# -{{ macros.config_row(config, 'http.enabled', '#http.enabled: false', 0, true) }} - - -################################### Gateway ################################### - -# The gateway allows for persisting the cluster state between full cluster -# restarts. Every change to the state (such as adding an index) will be stored -# in the gateway, and when the cluster starts up for the first time, -# it will read its state from the gateway. - -# There are several types of gateway implementations. For more information, see -# . - -# The default gateway type is the "local" gateway (recommended): -# -{{ macros.config_row(config, 'gateway.type', '#gateway.type: local', 0, true) }} - -# Settings below control how and when to start the initial recovery process on -# a full cluster restart (to reuse as much local data as possible when using shared -# gateway). - -# Allow recovery process after N nodes in a cluster are up: -# -{{ macros.config_row(config, 'gateway.recover_after_nodes', '#gateway.recover_after_nodes: 1', 0, true) }} - -# Set the timeout to initiate the recovery process, once the N nodes -# from previous setting are up (accepts time value): -# -{{ macros.config_row(config, 'gateway.recover_after_time', '#gateway.recover_after_time: 5m', 0, true) }} - -# Set how many nodes are expected in this cluster. Once these N nodes -# are up (and recover_after_nodes is met), begin recovery process immediately -# (without waiting for recover_after_time to expire): -# -{{ macros.config_row(config, 'gateway.expected_nodes', '#gateway.expected_nodes: 2', 0, true) }} - - -############################# Recovery Throttling ############################# - -# These settings allow to control the process of shards allocation between -# nodes during initial recovery, replica allocation, rebalancing, -# or when adding and removing nodes. - -# Set the number of concurrent recoveries happening on a node: -# -# 1. During the initial recovery -# -{{ macros.config_row(config, 'cluster.routing.allocation.node_initial_primaries_recoveries', '#cluster.routing.allocation.node_initial_primaries_recoveries: 4', 0, true) }} -# -# 2. During adding/removing nodes, rebalancing, etc -# -{{ macros.config_row(config, 'cluster.routing.allocation.node_concurrent_recoveries', '#cluster.routing.allocation.node_concurrent_recoveries: 2', 0, true) }} - -# Set to throttle throughput when recovering (eg. 100mb, by default 20mb): -# -{{ macros.config_row(config, 'indices.recovery.max_bytes_per_sec', '#indices.recovery.max_bytes_per_sec: 20mb', 0, true) }} - -# Set to limit the number of open concurrent streams when -# recovering a shard from a peer: -# -{{ macros.config_row(config, 'indices.recovery.concurrent_streams', '#indices.recovery.concurrent_streams: 5', 0, true) }} - - -################################## Discovery ################################## - -# Discovery infrastructure ensures nodes can be found within a cluster -# and master node is elected. Multicast discovery is the default. - -# Set to ensure a node sees N other master eligible nodes to be considered -# operational within the cluster. This should be set to a quorum/majority of -# the master-eligible nodes in the cluster. -# -{{ macros.config_row(config, 'discovery.zen.minimum_master_nodes', '#discovery.zen.minimum_master_nodes: 1', 0, true) }} - -# Set the time to wait for ping responses from other nodes when discovering. -# Set this option to a higher value on a slow or congested network -# to minimize discovery failures: -# -{{ macros.config_row(config, 'discovery.zen.ping.timeout', '#discovery.zen.ping.timeout: 3s', 0, true) }} - -# For more information, see -# - -# Unicast discovery allows to explicitly control which nodes will be used -# to discover the cluster. It can be used when multicast is not present, -# or to restrict the cluster communication-wise. -# -# 1. Disable multicast discovery (enabled by default): -# -{{ macros.config_row(config, 'discovery.zen.ping.multicast.enabled', '#discovery.zen.ping.multicast.enabled: false', 0, true) }} -# -# 2. Configure an initial list of master nodes in the cluster -# to perform discovery when new nodes (master or data) are started: -# -{{ macros.config_row(config, 'discovery.zen.ping.unicast.hosts', '#discovery.zen.ping.unicast.hosts: ["host1", "host2:port"]', 0, true) }} - -# EC2 discovery allows to use AWS EC2 API in order to perform discovery. -# -# You have to install the cloud-aws plugin for enabling the EC2 discovery. -# -# For more information, see -# -# -# See -# for a step-by-step tutorial. - -# GCE discovery allows to use Google Compute Engine API in order to perform discovery. -# -# You have to install the cloud-gce plugin for enabling the GCE discovery. -# -# For more information, see . - -# Azure discovery allows to use Azure API in order to perform discovery. -# -# You have to install the cloud-azure plugin for enabling the Azure discovery. -# -# For more information, see . - -################################## Slow Log ################################## - -# Shard level query and fetch threshold logging. - -{{ macros.config_row(config, 'index.search.slowlog.threshold.query.warn', '#index.search.slowlog.threshold.query.warn: 10s', 0, true) }} -{{ macros.config_row(config, 'index.search.slowlog.threshold.query.info', '#index.search.slowlog.threshold.query.info: 5s', 0, true) }} -{{ macros.config_row(config, 'index.search.slowlog.threshold.query.debug', '#index.search.slowlog.threshold.query.debug: 2s', 0, true) }} -{{ macros.config_row(config, 'index.search.slowlog.threshold.query.trace', '#index.search.slowlog.threshold.query.trace: 500ms', 0, true) }} - -{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.warn', '#index.search.slowlog.threshold.fetch.warn: 1s', 0, true) }} -{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.info', '#index.search.slowlog.threshold.fetch.info: 800ms', 0, true) }} -{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.debug', '#index.search.slowlog.threshold.fetch.debug: 500ms', 0, true) }} -{{ macros.config_row(config, 'index.search.slowlog.threshold.fetch.trace', '#index.search.slowlog.threshold.fetch.trace: 200ms', 0, true) }} - -{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.warn', '#index.indexing.slowlog.threshold.index.warn: 10s', 0, true) }} -{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.info', '#index.indexing.slowlog.threshold.index.info: 5s', 0, true) }} -{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.debug', '#index.indexing.slowlog.threshold.index.debug: 2s', 0, true) }} -{{ macros.config_row(config, 'index.indexing.slowlog.threshold.index.trace', '#index.indexing.slowlog.threshold.index.trace: 500ms', 0, true) }} - -################################## GC Logging ################################ - -{{ macros.config_row(config, 'monitor.jvm.gc.young.warn', '#monitor.jvm.gc.young.warn: 1000ms', 0, true) }} -{{ macros.config_row(config, 'monitor.jvm.gc.young.info', '#monitor.jvm.gc.young.info: 700ms', 0, true) }} -{{ macros.config_row(config, 'monitor.jvm.gc.young.debug', '#monitor.jvm.gc.young.debug: 400ms', 0, true) }} - -{{ macros.config_row(config, 'monitor.jvm.gc.young.warn', '#monitor.jvm.gc.old.warn: 10s', 0, true) }} -{{ macros.config_row(config, 'monitor.jvm.gc.young.info', '#monitor.jvm.gc.old.info: 5s', 0, true) }} -{{ macros.config_row(config, 'monitor.jvm.gc.young.debug', '#monitor.jvm.gc.old.debug: 2s', 0, true) }} - -################################## Security ################################ - -# Uncomment if you want to enable JSONP as a valid return transport on the -# http server. With this enabled, it may pose a security risk, so disabling -# it unless you need it is recommended (it is disabled by default). -# -{{ macros.config_row(config, 'http.jsonp.enable', '#http.jsonp.enable: true', 0, true) }} - -{{ macros.config(config, [ - 'cluster.name', - 'node.name', - 'node.master', - 'node.data', - 'node.max_local_storage_nodes', - 'index.number_of_shards', - 'index.number_of_replicas', - 'path.conf', - 'path.data', - 'path.work', - 'path.plugins', - 'plugin.mandatory', - 'bootstrap.mlockall', - 'network.bind_host', - 'network.publish_host', - 'network.host', - 'transport.tcp.port', - 'transport.tcp.compress', - 'http.port', - 'http.max_content_length', - 'http.enabled', - 'gateway.type', - 'gateway.recover_after_nodes', - 'gateway.recover_after_time', - 'gateway.expected_nodes', - 'cluster.routing.allocation.node_initial_primaries_recoveries', - 'cluster.routing.allocation.node_concurrent_recoveries', - 'indices.recovery.max_bytes_per_sec', - 'indices.recovery.concurrent_streams', - 'discovery.zen.minimum_master_nodes', - 'discovery.zen.ping.timeout', - 'discovery.zen.ping.multicast.enabled', - 'discovery.zen.ping.unicast.hosts', - 'index.search.slowlog.threshold.query.warn', - 'index.search.slowlog.threshold.query.info', - 'index.search.slowlog.threshold.query.debug', - 'index.search.slowlog.threshold.query.trace', - 'index.search.slowlog.threshold.fetch.warn', - 'index.search.slowlog.threshold.fetch.info', - 'index.search.slowlog.threshold.fetch.debug', - 'index.search.slowlog.threshold.fetch.trace', - 'index.indexing.slowlog.threshold.index.warn', - 'index.indexing.slowlog.threshold.index.info', - 'index.indexing.slowlog.threshold.index.debug', - 'index.indexing.slowlog.threshold.index.trace', - 'monitor.jvm.gc.young.warn', - 'monitor.jvm.gc.young.info', - 'monitor.jvm.gc.young.debug', - 'monitor.jvm.gc.young.warn', - 'monitor.jvm.gc.young.info', - 'monitor.jvm.gc.young.debug', - 'http.jsonp.enable' -]) -}} +{%- set template_env = '' -%} +{%- include '_base.j2' -%} diff --git a/manala.elasticsearch/tests/0400_services.goss.yml b/manala.elasticsearch/tests/0200_install.1.5.goss.yml similarity index 58% rename from manala.elasticsearch/tests/0400_services.goss.yml rename to manala.elasticsearch/tests/0200_install.1.5.goss.yml index f0c700c00..6932776a7 100644 --- a/manala.elasticsearch/tests/0400_services.goss.yml +++ b/manala.elasticsearch/tests/0200_install.1.5.goss.yml @@ -1,5 +1,9 @@ --- +package: + elasticsearch: + installed: true + service: elasticsearch: enabled: true diff --git a/manala.elasticsearch/tests/0200_install.1.5.yml b/manala.elasticsearch/tests/0200_install.1.5.yml new file mode 100644 index 000000000..4dd41718b --- /dev/null +++ b/manala.elasticsearch/tests/0200_install.1.5.yml @@ -0,0 +1,40 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + pre_tasks: + - include: pre_tasks/elasticsearch_1.5.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + pre_tasks: + - include: pre_tasks/elasticsearch_1.5.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0200_install.goss.yml b/manala.elasticsearch/tests/0200_install.goss.yml deleted file mode 100644 index 96bd00ab0..000000000 --- a/manala.elasticsearch/tests/0200_install.goss.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -package: - elasticsearch: - installed: true diff --git a/manala.elasticsearch/tests/0200_install.yml b/manala.elasticsearch/tests/0200_install.yml deleted file mode 100644 index 19cafc341..000000000 --- a/manala.elasticsearch/tests/0200_install.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- - -- name: "{{ test }}" - hosts: debian - become: true - pre_tasks: - - include: pre_tasks/elasticsearch.yml - - apt: - name: "{{ item }}" - install_recommends: false - with_items: - - openjdk-7-jre - roles: - - manala.elasticsearch - post_tasks: - - name: Goss - command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0201_install.1.6.goss.yml b/manala.elasticsearch/tests/0201_install.1.6.goss.yml new file mode 100644 index 000000000..6932776a7 --- /dev/null +++ b/manala.elasticsearch/tests/0201_install.1.6.goss.yml @@ -0,0 +1,10 @@ +--- + +package: + elasticsearch: + installed: true + +service: + elasticsearch: + enabled: true + running: true diff --git a/manala.elasticsearch/tests/0201_install.1.6.yml b/manala.elasticsearch/tests/0201_install.1.6.yml new file mode 100644 index 000000000..7a8962f87 --- /dev/null +++ b/manala.elasticsearch/tests/0201_install.1.6.yml @@ -0,0 +1,40 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + pre_tasks: + - include: pre_tasks/elasticsearch_1.6.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + pre_tasks: + - include: pre_tasks/elasticsearch_1.6.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0202_install.1.7.goss.yml b/manala.elasticsearch/tests/0202_install.1.7.goss.yml new file mode 100644 index 000000000..6932776a7 --- /dev/null +++ b/manala.elasticsearch/tests/0202_install.1.7.goss.yml @@ -0,0 +1,10 @@ +--- + +package: + elasticsearch: + installed: true + +service: + elasticsearch: + enabled: true + running: true diff --git a/manala.elasticsearch/tests/0202_install.1.7.yml b/manala.elasticsearch/tests/0202_install.1.7.yml new file mode 100644 index 000000000..b633f2ee1 --- /dev/null +++ b/manala.elasticsearch/tests/0202_install.1.7.yml @@ -0,0 +1,40 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + pre_tasks: + - include: pre_tasks/elasticsearch_1.7.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + pre_tasks: + - include: pre_tasks/elasticsearch_1.7.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0203_install.2.goss.yml b/manala.elasticsearch/tests/0203_install.2.goss.yml new file mode 100644 index 000000000..6932776a7 --- /dev/null +++ b/manala.elasticsearch/tests/0203_install.2.goss.yml @@ -0,0 +1,10 @@ +--- + +package: + elasticsearch: + installed: true + +service: + elasticsearch: + enabled: true + running: true diff --git a/manala.elasticsearch/tests/0203_install.2.yml b/manala.elasticsearch/tests/0203_install.2.yml new file mode 100644 index 000000000..7eabceeb4 --- /dev/null +++ b/manala.elasticsearch/tests/0203_install.2.yml @@ -0,0 +1,40 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + pre_tasks: + - include: pre_tasks/elasticsearch_2.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + pre_tasks: + - include: pre_tasks/elasticsearch_2.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0204_install.5.goss.yml b/manala.elasticsearch/tests/0204_install.5.goss.yml new file mode 100644 index 000000000..6932776a7 --- /dev/null +++ b/manala.elasticsearch/tests/0204_install.5.goss.yml @@ -0,0 +1,10 @@ +--- + +package: + elasticsearch: + installed: true + +service: + elasticsearch: + enabled: true + running: true diff --git a/manala.elasticsearch/tests/0204_install.5.yml b/manala.elasticsearch/tests/0204_install.5.yml new file mode 100644 index 000000000..ff06ffac2 --- /dev/null +++ b/manala.elasticsearch/tests/0204_install.5.yml @@ -0,0 +1,24 @@ +--- + +- name: "{{ test }}" + hosts: debian.jessie + become: true + pre_tasks: + - include: pre_tasks/elasticsearch_5.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0300_config.goss.yml b/manala.elasticsearch/tests/0300_config.1.5.goss.yml similarity index 77% rename from manala.elasticsearch/tests/0300_config.goss.yml rename to manala.elasticsearch/tests/0300_config.1.5.goss.yml index 622dec263..f594a3a8d 100644 --- a/manala.elasticsearch/tests/0300_config.goss.yml +++ b/manala.elasticsearch/tests/0300_config.1.5.goss.yml @@ -3,9 +3,7 @@ file: /etc/elasticsearch/elasticsearch.yml: exists: true - mode: "0750" owner: root - group: elasticsearch filetype: file contains: - "node.name: Foo Bar" diff --git a/manala.elasticsearch/tests/0300_config.1.5.yml b/manala.elasticsearch/tests/0300_config.1.5.yml new file mode 100644 index 000000000..c39442340 --- /dev/null +++ b/manala.elasticsearch/tests/0300_config.1.5.yml @@ -0,0 +1,46 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + vars: + manala_elasticsearch_config: + - node.name: Foo Bar + pre_tasks: + - include: pre_tasks/elasticsearch_1.5.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + vars: + manala_elasticsearch_config: + - node.name: Foo Bar + pre_tasks: + - include: pre_tasks/elasticsearch_1.5.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0300_config.yml b/manala.elasticsearch/tests/0300_config.yml deleted file mode 100644 index e9d25c56e..000000000 --- a/manala.elasticsearch/tests/0300_config.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- - -- name: "{{ test }}" - hosts: debian - become: true - vars: - manala_elasticsearch_config: - - node.name: Foo Bar - pre_tasks: - - include: pre_tasks/elasticsearch.yml - - apt: - name: "{{ item }}" - install_recommends: false - with_items: - - openjdk-7-jre - roles: - - manala.elasticsearch - post_tasks: - - name: Goss - command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0301_config.1.6.goss.yml b/manala.elasticsearch/tests/0301_config.1.6.goss.yml new file mode 100644 index 000000000..f594a3a8d --- /dev/null +++ b/manala.elasticsearch/tests/0301_config.1.6.goss.yml @@ -0,0 +1,9 @@ +--- + +file: + /etc/elasticsearch/elasticsearch.yml: + exists: true + owner: root + filetype: file + contains: + - "node.name: Foo Bar" diff --git a/manala.elasticsearch/tests/0301_config.1.6.yml b/manala.elasticsearch/tests/0301_config.1.6.yml new file mode 100644 index 000000000..28900485c --- /dev/null +++ b/manala.elasticsearch/tests/0301_config.1.6.yml @@ -0,0 +1,46 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + vars: + manala_elasticsearch_config: + - node.name: Foo Bar + pre_tasks: + - include: pre_tasks/elasticsearch_1.6.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + vars: + manala_elasticsearch_config: + - node.name: Foo Bar + pre_tasks: + - include: pre_tasks/elasticsearch_1.6.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0302_config.1.7.goss.yml b/manala.elasticsearch/tests/0302_config.1.7.goss.yml new file mode 100644 index 000000000..f594a3a8d --- /dev/null +++ b/manala.elasticsearch/tests/0302_config.1.7.goss.yml @@ -0,0 +1,9 @@ +--- + +file: + /etc/elasticsearch/elasticsearch.yml: + exists: true + owner: root + filetype: file + contains: + - "node.name: Foo Bar" diff --git a/manala.elasticsearch/tests/0302_config.1.7.yml b/manala.elasticsearch/tests/0302_config.1.7.yml new file mode 100644 index 000000000..72fac8907 --- /dev/null +++ b/manala.elasticsearch/tests/0302_config.1.7.yml @@ -0,0 +1,46 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + vars: + manala_elasticsearch_config: + - node.name: Foo Bar + pre_tasks: + - include: pre_tasks/elasticsearch_1.7.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + vars: + manala_elasticsearch_config: + - node.name: Foo Bar + pre_tasks: + - include: pre_tasks/elasticsearch_1.7.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0303_config.2.goss.yml b/manala.elasticsearch/tests/0303_config.2.goss.yml new file mode 100644 index 000000000..f594a3a8d --- /dev/null +++ b/manala.elasticsearch/tests/0303_config.2.goss.yml @@ -0,0 +1,9 @@ +--- + +file: + /etc/elasticsearch/elasticsearch.yml: + exists: true + owner: root + filetype: file + contains: + - "node.name: Foo Bar" diff --git a/manala.elasticsearch/tests/0303_config.2.yml b/manala.elasticsearch/tests/0303_config.2.yml new file mode 100644 index 000000000..4aa68503f --- /dev/null +++ b/manala.elasticsearch/tests/0303_config.2.yml @@ -0,0 +1,46 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + vars: + manala_elasticsearch_config: + - node.name: Foo Bar + pre_tasks: + - include: pre_tasks/elasticsearch_2.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + vars: + manala_elasticsearch_config: + - node.name: Foo Bar + pre_tasks: + - include: pre_tasks/elasticsearch_2.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0304_config.5.goss.yml b/manala.elasticsearch/tests/0304_config.5.goss.yml new file mode 100644 index 000000000..f594a3a8d --- /dev/null +++ b/manala.elasticsearch/tests/0304_config.5.goss.yml @@ -0,0 +1,9 @@ +--- + +file: + /etc/elasticsearch/elasticsearch.yml: + exists: true + owner: root + filetype: file + contains: + - "node.name: Foo Bar" diff --git a/manala.elasticsearch/tests/0304_config.5.yml b/manala.elasticsearch/tests/0304_config.5.yml new file mode 100644 index 000000000..aa68d094a --- /dev/null +++ b/manala.elasticsearch/tests/0304_config.5.yml @@ -0,0 +1,27 @@ +--- + +- name: "{{ test }}" + hosts: debian.jessie + become: true + vars: + manala_elasticsearch_config: + - node.name: Foo Bar + pre_tasks: + - include: pre_tasks/elasticsearch_5.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0400_services.yml b/manala.elasticsearch/tests/0400_services.yml deleted file mode 100644 index 19cafc341..000000000 --- a/manala.elasticsearch/tests/0400_services.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- - -- name: "{{ test }}" - hosts: debian - become: true - pre_tasks: - - include: pre_tasks/elasticsearch.yml - - apt: - name: "{{ item }}" - install_recommends: false - with_items: - - openjdk-7-jre - roles: - - manala.elasticsearch - post_tasks: - - name: Goss - command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0500_plugins.1.5.goss.yml b/manala.elasticsearch/tests/0500_plugins.1.5.goss.yml new file mode 100644 index 000000000..5d12cdaae --- /dev/null +++ b/manala.elasticsearch/tests/0500_plugins.1.5.goss.yml @@ -0,0 +1,7 @@ +--- + +command: + /usr/share/elasticsearch/bin/plugin --list: + exit-status: 0 + stdout: + - "- head" diff --git a/manala.elasticsearch/tests/0500_plugins.1.5.yml b/manala.elasticsearch/tests/0500_plugins.1.5.yml new file mode 100644 index 000000000..af6f80a1b --- /dev/null +++ b/manala.elasticsearch/tests/0500_plugins.1.5.yml @@ -0,0 +1,46 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + vars: + manala_elasticsearch_plugins: + - mobz/elasticsearch-head + pre_tasks: + - include: pre_tasks/elasticsearch_1.5.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + vars: + manala_elasticsearch_plugins: + - mobz/elasticsearch-head + pre_tasks: + - include: pre_tasks/elasticsearch_1.5.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0501_plugins.1.6.goss.yml b/manala.elasticsearch/tests/0501_plugins.1.6.goss.yml new file mode 100644 index 000000000..5d12cdaae --- /dev/null +++ b/manala.elasticsearch/tests/0501_plugins.1.6.goss.yml @@ -0,0 +1,7 @@ +--- + +command: + /usr/share/elasticsearch/bin/plugin --list: + exit-status: 0 + stdout: + - "- head" diff --git a/manala.elasticsearch/tests/0501_plugins.1.6.yml b/manala.elasticsearch/tests/0501_plugins.1.6.yml new file mode 100644 index 000000000..e8fc9da96 --- /dev/null +++ b/manala.elasticsearch/tests/0501_plugins.1.6.yml @@ -0,0 +1,46 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + vars: + manala_elasticsearch_plugins: + - mobz/elasticsearch-head + pre_tasks: + - include: pre_tasks/elasticsearch_1.6.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + vars: + manala_elasticsearch_plugins: + - mobz/elasticsearch-head + pre_tasks: + - include: pre_tasks/elasticsearch_1.6.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0502_plugins.1.7.goss.yml b/manala.elasticsearch/tests/0502_plugins.1.7.goss.yml new file mode 100644 index 000000000..5d12cdaae --- /dev/null +++ b/manala.elasticsearch/tests/0502_plugins.1.7.goss.yml @@ -0,0 +1,7 @@ +--- + +command: + /usr/share/elasticsearch/bin/plugin --list: + exit-status: 0 + stdout: + - "- head" diff --git a/manala.elasticsearch/tests/0502_plugins.1.7.yml b/manala.elasticsearch/tests/0502_plugins.1.7.yml new file mode 100644 index 000000000..8e81945ca --- /dev/null +++ b/manala.elasticsearch/tests/0502_plugins.1.7.yml @@ -0,0 +1,46 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + vars: + manala_elasticsearch_plugins: + - mobz/elasticsearch-head + pre_tasks: + - include: pre_tasks/elasticsearch_1.7.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + vars: + manala_elasticsearch_plugins: + - mobz/elasticsearch-head + pre_tasks: + - include: pre_tasks/elasticsearch_1.7.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/0503_plugins.2.goss.yml b/manala.elasticsearch/tests/0503_plugins.2.goss.yml new file mode 100644 index 000000000..00d5b3fab --- /dev/null +++ b/manala.elasticsearch/tests/0503_plugins.2.goss.yml @@ -0,0 +1,7 @@ +--- + +command: + /usr/share/elasticsearch/bin/plugin list: + exit-status: 0 + stdout: + - "- head" diff --git a/manala.elasticsearch/tests/0503_plugins.2.yml b/manala.elasticsearch/tests/0503_plugins.2.yml new file mode 100644 index 000000000..cf59db594 --- /dev/null +++ b/manala.elasticsearch/tests/0503_plugins.2.yml @@ -0,0 +1,46 @@ +--- + +- name: "{{ test }}" + hosts: debian.wheezy + become: true + vars: + manala_elasticsearch_plugins: + - mobz/elasticsearch-head + pre_tasks: + - include: pre_tasks/elasticsearch_2.yml + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-7-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate + +- name: "{{ test }}" + hosts: debian.jessie + become: true + vars: + manala_elasticsearch_plugins: + - mobz/elasticsearch-head + pre_tasks: + - include: pre_tasks/elasticsearch_2.yml + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + - apt: + name: "{{ item }}" + install_recommends: false + with_items: + - openjdk-8-jre-headless + roles: + - manala.elasticsearch + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.elasticsearch/tests/pre_tasks/backports.yml b/manala.elasticsearch/tests/pre_tasks/backports.yml new file mode 100644 index 000000000..0c24b8893 --- /dev/null +++ b/manala.elasticsearch/tests/pre_tasks/backports.yml @@ -0,0 +1,5 @@ +--- + +- name: Pre tasks > Backports apt repository + apt_repository: + repo: deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main diff --git a/manala.elasticsearch/tests/pre_tasks/elasticsearch_1.5.yml b/manala.elasticsearch/tests/pre_tasks/elasticsearch_1.5.yml new file mode 100644 index 000000000..cc2e0a5c9 --- /dev/null +++ b/manala.elasticsearch/tests/pre_tasks/elasticsearch_1.5.yml @@ -0,0 +1,10 @@ +--- + +- name: Pre tasks > Elasticsearch apt key + apt_key: + file: pre_tasks/apt_keys/elasticsearch.pgp + id: D88E42B4 + +- name: Pre tasks > Elasticsearch 1.5 apt repository + apt_repository: + repo: deb https://packages.elastic.co/elasticsearch/1.5/debian stable main diff --git a/manala.elasticsearch/tests/pre_tasks/elasticsearch_1.6.yml b/manala.elasticsearch/tests/pre_tasks/elasticsearch_1.6.yml new file mode 100644 index 000000000..7e6f6df3a --- /dev/null +++ b/manala.elasticsearch/tests/pre_tasks/elasticsearch_1.6.yml @@ -0,0 +1,10 @@ +--- + +- name: Pre tasks > Elasticsearch apt key + apt_key: + file: pre_tasks/apt_keys/elasticsearch.pgp + id: D88E42B4 + +- name: Pre tasks > Elasticsearch 1.6 apt repository + apt_repository: + repo: deb https://packages.elastic.co/elasticsearch/1.6/debian stable main diff --git a/manala.elasticsearch/tests/pre_tasks/elasticsearch_1.7.yml b/manala.elasticsearch/tests/pre_tasks/elasticsearch_1.7.yml new file mode 100644 index 000000000..4ed331ca2 --- /dev/null +++ b/manala.elasticsearch/tests/pre_tasks/elasticsearch_1.7.yml @@ -0,0 +1,10 @@ +--- + +- name: Pre tasks > Elasticsearch apt key + apt_key: + file: pre_tasks/apt_keys/elasticsearch.pgp + id: D88E42B4 + +- name: Pre tasks > Elasticsearch 1.7 apt repository + apt_repository: + repo: deb https://packages.elastic.co/elasticsearch/1.7/debian stable main diff --git a/manala.elasticsearch/tests/pre_tasks/elasticsearch_2.yml b/manala.elasticsearch/tests/pre_tasks/elasticsearch_2.yml new file mode 100644 index 000000000..ae66b4ea8 --- /dev/null +++ b/manala.elasticsearch/tests/pre_tasks/elasticsearch_2.yml @@ -0,0 +1,10 @@ +--- + +- name: Pre tasks > Elasticsearch apt key + apt_key: + file: pre_tasks/apt_keys/elasticsearch.pgp + id: D88E42B4 + +- name: Pre tasks > Elasticsearch 2 apt repository + apt_repository: + repo: deb https://packages.elastic.co/elasticsearch/2.x/debian stable main diff --git a/manala.elasticsearch/tests/pre_tasks/elasticsearch.yml b/manala.elasticsearch/tests/pre_tasks/elasticsearch_5.yml similarity index 52% rename from manala.elasticsearch/tests/pre_tasks/elasticsearch.yml rename to manala.elasticsearch/tests/pre_tasks/elasticsearch_5.yml index 207631bbc..7073ff6ff 100644 --- a/manala.elasticsearch/tests/pre_tasks/elasticsearch.yml +++ b/manala.elasticsearch/tests/pre_tasks/elasticsearch_5.yml @@ -5,6 +5,6 @@ file: pre_tasks/apt_keys/elasticsearch.pgp id: D88E42B4 -- name: Pre tasks > Elasticsearch apt repository +- name: Pre tasks > Elasticsearch 5 apt repository apt_repository: - repo: deb http://packages.elastic.co/elasticsearch/2.x/debian stable main + repo: deb https://artifacts.elastic.co/packages/5.x/apt stable main diff --git a/manala.java/CHANGELOG.md b/manala.java/CHANGELOG.md index 977cef229..dec160e4c 100644 --- a/manala.java/CHANGELOG.md +++ b/manala.java/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Changed +- Switch to headless packages +- Handle version +- Support version 8 ## [1.0.0] - 2017-05-29 ### Added diff --git a/manala.java/defaults/main.yml b/manala.java/defaults/main.yml new file mode 100644 index 000000000..6eab207b5 --- /dev/null +++ b/manala.java/defaults/main.yml @@ -0,0 +1,4 @@ +--- + +# Java version. Available values are '~' (autodetect), '7', '8' +manala_java_version: ~ diff --git a/manala.java/tasks/install.yml b/manala.java/tasks/install.yml index 2f79c1715..8701716f0 100644 --- a/manala.java/tasks/install.yml +++ b/manala.java/tasks/install.yml @@ -8,4 +8,8 @@ update_cache: true cache_valid_time: 3600 with_items: - - openjdk-7-jre + - "{{ + 'openjdk-' ~ manala_java_version ~ '-jre-headless' + if (manala_java_version) else + 'default-jre-headless' + }}" diff --git a/manala.java/tasks/main.yml b/manala.java/tasks/main.yml index a13ef0711..361e50b08 100644 --- a/manala.java/tasks/main.yml +++ b/manala.java/tasks/main.yml @@ -1,5 +1,10 @@ --- +# Requirements +- include: requirements.yml + tags: + - manala_java + # Install - include: install.yml tags: diff --git a/manala.java/tasks/requirements.yml b/manala.java/tasks/requirements.yml new file mode 100644 index 000000000..ca5f3eead --- /dev/null +++ b/manala.java/tasks/requirements.yml @@ -0,0 +1,10 @@ +--- + +- name: requirements > Version + fail: + msg: Your "manala_java_version" is not compatible with your release + when: + - manala_java_version != None + - manala_java_version|version_compare('7', '>') + and ansible_distribution_release == 'wheezy' + check_mode: false diff --git a/manala.java/tests/0100_install.goss.yml b/manala.java/tests/0100_install.goss.yml index 5460b86ae..a6055cb19 100644 --- a/manala.java/tests/0100_install.goss.yml +++ b/manala.java/tests/0100_install.goss.yml @@ -1,5 +1,7 @@ --- -package: - openjdk-7-jre: - installed: true +command: + java -version: + exit-status: 0 + stderr: + - "/^java version \"1\\..*\"$/" diff --git a/manala.java/tests/0101_install.7.goss.yml b/manala.java/tests/0101_install.7.goss.yml new file mode 100644 index 000000000..138f3f3ea --- /dev/null +++ b/manala.java/tests/0101_install.7.goss.yml @@ -0,0 +1,7 @@ +--- + +command: + java -version: + exit-status: 0 + stderr: + - "/^java version \"1\\.7\\..*\"$/" diff --git a/manala.java/tests/0101_install.7.yml b/manala.java/tests/0101_install.7.yml new file mode 100644 index 000000000..d869acba1 --- /dev/null +++ b/manala.java/tests/0101_install.7.yml @@ -0,0 +1,12 @@ +--- + +- name: "{{ test }}" + hosts: debian + become: true + vars: + manala_java_version: 7 + roles: + - manala.java + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.java/tests/0102_install.8.goss.yml b/manala.java/tests/0102_install.8.goss.yml new file mode 100644 index 000000000..16dff9ffc --- /dev/null +++ b/manala.java/tests/0102_install.8.goss.yml @@ -0,0 +1,7 @@ +--- + +command: + java -version: + exit-status: 0 + stderr: + - "/^openjdk version \"1\\.8\\..*\"$/" diff --git a/manala.java/tests/0102_install.8.yml b/manala.java/tests/0102_install.8.yml new file mode 100644 index 000000000..267104aad --- /dev/null +++ b/manala.java/tests/0102_install.8.yml @@ -0,0 +1,20 @@ +--- + +- name: "{{ test }}" + hosts: debian.jessie + become: true + vars: + manala_java_version: 8 + pre_tasks: + - include: pre_tasks/backports.yml + - copy: + dest: /etc/apt/preferences.d/openjdk + content: | + Package: openjdk-* ca-certificates-java + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 900 + roles: + - manala.java + post_tasks: + - name: Goss + command: goss --gossfile {{ test }}.goss.yml validate diff --git a/manala.java/tests/pre_tasks/backports.yml b/manala.java/tests/pre_tasks/backports.yml new file mode 100644 index 000000000..0c24b8893 --- /dev/null +++ b/manala.java/tests/pre_tasks/backports.yml @@ -0,0 +1,5 @@ +--- + +- name: Pre tasks > Backports apt repository + apt_repository: + repo: deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main diff --git a/manala.skeleton/CHANGELOG.md b/manala.skeleton/CHANGELOG.md index 1a19dff83..9691dcd17 100644 --- a/manala.skeleton/CHANGELOG.md +++ b/manala.skeleton/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Added - Exa package from manala by default +- Elasticsearch 5 support (become default) (elasticsearch-head plugin not supported) +- Java version 8 (backports) for debian jessie ## [1.0.5] - 2017-10-09 ### Added diff --git a/manala.skeleton/defaults/main.yml b/manala.skeleton/defaults/main.yml index ec2050f29..134bb695e 100644 --- a/manala.skeleton/defaults/main.yml +++ b/manala.skeleton/defaults/main.yml @@ -57,7 +57,7 @@ manala_skeleton_options: mongodb_version: '3.2' mongo_express: false elasticsearch: false - elasticsearch_version: '1.7' + elasticsearch_version: '5' # '1.5'|'1.6'|'1.7'|'2'|'5' influxdb: false dnsmasq: false sqlite: false diff --git a/manala.skeleton/vars/main.yml b/manala.skeleton/vars/main.yml index 94ee729ea..07de60c8a 100644 --- a/manala.skeleton/vars/main.yml +++ b/manala.skeleton/vars/main.yml @@ -53,6 +53,7 @@ manala_skeleton_patterns: 'python-six@backports' ], 'jessie': [ + 'openjdk@backports', 'git@backports', 'htop@backports', 'python-pathlib2@backports', @@ -83,7 +84,7 @@ manala_skeleton_patterns: + (manala_skeleton_options.phppgadmin)|ternary(['phppgadmin@manala'],[]) + (manala_skeleton_options.redis)|ternary(['redis@dotdeb'],[]) + (manala_skeleton_options.mongodb)|ternary(['mongodb@mongodb' ~ {'3.0': '_3_0', '3.2': '_3_2'}[manala_skeleton_options.mongodb_version|string]],[]) - + (manala_skeleton_options.elasticsearch)|ternary(['elasticsearch@elasticsearch' ~ {'1.5': '_1_5', '1.6': '_1_6', '1.7': '_1_7', '2': '_2'}[manala_skeleton_options.elasticsearch_version|string]],[]) + + (manala_skeleton_options.elasticsearch)|ternary(['elasticsearch@elasticsearch' ~ {'1.5': '_1_5', '1.6': '_1_6', '1.7': '_1_7', '2': '_2', '5': '_5'}[manala_skeleton_options.elasticsearch_version|string]],[]) + (manala_skeleton_options.influxdb)|ternary(['influxdb@influxdata'],[]) }}" apt_update_holds: "{{ @@ -156,6 +157,13 @@ manala_skeleton_patterns: ngrok_configs: - file: config.yml template: configs/default.{{ manala_skeleton_env }}.j2 + # Ngrok + java_version: "{{ + { + 'wheezy': '7', + 'jessie': '8' + }[ansible_distribution_release] + }}" # Php php_version: "{{ ({'5.4': 5, '5.5': 5, '5.6': 5, '7.0': 7.0, '7.1': 7.1})[manala_skeleton_options.php_version|string] }}" php_sapis_exclusive: true @@ -378,8 +386,15 @@ manala_skeleton_patterns: # Mongo Express mongo_express_config_template: config/default.{{ manala_skeleton_env }}.j2 # Elasticsearch - elasticsearch_plugins: - - mobz/elasticsearch-head + elasticsearch_plugins: "{{ + { + '1.5': ['mobz/elasticsearch-head'], + '1.6': ['mobz/elasticsearch-head'], + '1.7': ['mobz/elasticsearch-head'], + '2': ['mobz/elasticsearch-head'], + '5': [] + }[manala_skeleton_options.elasticsearch_version|string] + }}" # PhantomJS phantomjs_config_template: config/default.{{ manala_skeleton_env }}.j2 # Heka