From 276e228f750e65f9e4e55f0f16f14277e37e25aa Mon Sep 17 00:00:00 2001 From: Julien Mailleret Date: Fri, 6 Dec 2019 22:16:17 +0100 Subject: [PATCH 1/3] [7.5.0] bump elasticsearch version --- README.md | 10 +++++----- defaults/main.yml | 2 +- helpers/bumper.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index da29fe3..22c815a 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This role uses the json_query filter which [requires jmespath](https://github.co Create your Ansible playbook with your own tasks, and include the role elasticsearch. You will have to have this repository accessible within the context of playbook. ```sh -ansible-galaxy install elastic.elasticsearch,7.4.2 +ansible-galaxy install elastic.elasticsearch,7.5.0 ``` Then create your playbook yaml adding the role elasticsearch. @@ -46,14 +46,14 @@ The simplest configuration therefore consists of: roles: - role: elastic.elasticsearch vars: - es_version: 7.4.2 + es_version: 7.5.0 ``` -The above installs Elasticsearch 7.4.2 in a single node 'node1' on the hosts 'localhost'. +The above installs Elasticsearch 7.5.0 in a single node 'node1' on the hosts 'localhost'. **Note**: Elasticsearch default version is described in [`es_version`](defaults/main.yml#L2). You can override this variable in your playbook to install another version. -While we are testing this role only with one 7.x and one 6.x version (respectively [7.4.2](defaults/main.yml#L2) and [6.8.5](.kitchen.yml#L22) at the time of writing), this role should work with others version also in most cases. +While we are testing this role only with one 7.x and one 6.x version (respectively [7.5.0](defaults/main.yml#L2) and [6.8.5](.kitchen.yml#L22) at the time of writing), this role should work with others version also in most cases. This role also uses [Ansible tags](http://docs.ansible.com/ansible/playbooks_tags.html). Run your playbook with the `--list-tasks` flag for more information. @@ -381,7 +381,7 @@ In addition to es_config, the following parameters allow the customization of th * ```es_enable_xpack``` Default `true`. Setting this to `false` will install the oss release of elasticsearch * `es_xpack_trial` Default `false`. Setting this to `true` will start the 30-day trail once the cluster starts. -* ```es_version``` (e.g. "7.4.2"). +* ```es_version``` (e.g. "7.5.0"). * ```es_api_host``` The host name used for actions requiring HTTP e.g. installing templates. Defaults to "localhost". * ```es_api_port``` The port used for actions requiring HTTP e.g. installing templates. Defaults to 9200. **CHANGE IF THE HTTP PORT IS NOT 9200** * ```es_api_basic_auth_username``` The Elasticsearch username for making admin changing actions. Used if Security is enabled. Ensure this user is admin. diff --git a/defaults/main.yml b/defaults/main.yml index 35d1ec3..8647d2f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ --- -es_version: "7.4.2" +es_version: "7.5.0" es_use_snapshot_release: false es_enable_xpack: true es_package_name: "elasticsearch" diff --git a/helpers/bumper.py b/helpers/bumper.py index 2d8cd43..2c292f2 100755 --- a/helpers/bumper.py +++ b/helpers/bumper.py @@ -15,12 +15,12 @@ os.chdir(os.path.join(os.path.dirname(__file__), '..')) old_versions = { 6: '6.8.4', - 7: '7.4.1', + 7: '7.4.2', } new_versions = { 6: '6.8.5', - 7: '7.4.2', + 7: '7.5.0', } files = [ From 3292766b090feaff0678f42629a8a568d8791120 Mon Sep 17 00:00:00 2001 From: Julien Mailleret Date: Fri, 6 Dec 2019 22:17:53 +0100 Subject: [PATCH 2/3] [7.5.0] update jvm.options template to 7.5.0 dafault values --- templates/jvm.options.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/jvm.options.j2 b/templates/jvm.options.j2 index dd908d7..544e4ee 100644 --- a/templates/jvm.options.j2 +++ b/templates/jvm.options.j2 @@ -47,13 +47,14 @@ # 10-:-XX:-UseConcMarkSweepGC # 10-:-XX:-UseCMSInitiatingOccupancyOnly # 10-:-XX:+UseG1GC -{% if es_version is version('7.3.0', '<=') %} +{% if es_version is version('7.4.0', '<') %} # 10-:-XX:InitiatingHeapOccupancyPercent=75 {% else %} # 10-:-XX:G1ReservePercent=25 # 10-:-XX:InitiatingHeapOccupancyPercent=30 {% endif %} +{% if es_version is version('7.5.0', '<') %} ## DNS cache policy # cache ttl in seconds for positive DNS lookups noting that this overrides the # JDK security property networkaddress.cache.ttl; set to -1 to cache forever @@ -97,6 +98,7 @@ # log4j 2 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true +{% endif %} -Djava.io.tmpdir=${ES_TMPDIR} @@ -126,6 +128,7 @@ # JDK 9+ GC logging 9-:-Xlog:gc*,gc+age=trace,safepoint:file={{ es_log_dir }}/gc.log:utctime,pid,tags:filecount=32,filesize=64m +{% if es_version is version('7.5.0', '<') %} # due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise # time/date parsing will break in an incompatible way for some date patterns and locals 9-:-Djava.locale.providers=COMPAT @@ -134,6 +137,7 @@ # temporary workaround for C2 bug with JDK 10 on hardware with AVX-512 10-:-XX:UseAVX=2 {% endif %} +{% endif %} {% if es_jvm_custom_parameters !='' %} {% for item in es_jvm_custom_parameters %} From e208f78e75fdb56b897edd709f86080a2043fa76 Mon Sep 17 00:00:00 2001 From: Julien Mailleret Date: Fri, 6 Dec 2019 23:10:14 +0100 Subject: [PATCH 3/3] [7.5.0] update changelog and breaking changes notices --- CHANGELOG.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 23 +++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b488158..41f7a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,50 @@ # Changelog +## 7.5.0 - 2019/12/09 + +* 7.5.0 as default version +* 6.8.5 as 6.x tested version + +### Breaking changes + +#### Removing the MAX_THREAD settings + +Ansible-elasticsearch 7.5.0 is removing the option to customize the maximum number of threads the process can start in [#637](https://github.com/elastic/ansible-elasticsearch/pull/637/files#diff-04c6e90faac2675aa89e2176d2eec7d8L408). +We discovered that this option wasn't working anymore since multi-instance support removal in ansible-elasticsearch 7.1.1. +This option will be added back in a following release if it's still relevant regarding latest Elasticsearch evolutions. + +#### Changes about configuration files + +Ansible-elasticsearch 7.5.0 is updating the configuration files provided by this role in [#637](https://github.com/elastic/ansible-elasticsearch/pull/637) which contained some otions deprecated in 6.x and 7.x: +- `/etc/default/elasticsearch`|`/etc/sysconfig/elasticsearch`: the new template reflect the configuration file provided by Elasticsearch >= 6.x, the parameter we removed were already not used in 6.x and 7.x +- `/etc/elasticsearch/jvm.options`: the new template reflect the configuration files provided by Elasticsearch >= 6.x +- `/etc/elasticsearch/log4j2.properties`: + - We removed `log4j2.properties.j2` template from this Ansible role as it was a static file not bringing any customization specific to some ansible variable. + - Deployment of this Ansible role on new servers will get the default `log4j2.properties` provided by Elastisearch without any override. + - **WARNING**: For upgrade scenarios where this file was already managed by previous versions of ansible-elasticsearch, this file will become unmanaged and won't be updated by default. If you wish to update it to 7.5 version, you can retrieve it [here](https://github.com/elastic/elasticsearch/blob/7.5/distribution/src/config/log4j2.properties) and use this file with `es_config_log4j2` Ansible variable (see below). + +##### How to override configuration files provided by ansible-elasticsearch? + +You can now override the configuration files with your own versions by using the following Ansible variables: +- `es_config_default: "elasticsearch.j2"`: replace `elasticsearch.j2` by your own template to use a custom `/etc/default/elasticsearch`|`/etc/sysconfig/elasticsearch` configuration file +- `es_config_jvm: "jvm.options.j2"`: replace `jvm.options.j2` by your own template to use a custom `/etc/elasticsearch/jvm.options` configuration file +- `es_config_log4j2: ""`: set this variable to the path of your own template to use a custom `/etc/elasticsearch/log4j2.properties` configuration file + +### SSL/TLS Support + +Ansible-elasticsearch is now supporting SSL/TLS encryption. Please refer to [X-Pack Security SSL/TLS](https://github.com/elastic/ansible-elasticsearch/blob/master/docs/ssl-tls-setup.md) to configure it. + +| PR | Author | Title | +| ---------------------------------------------------------------- | ---------------------------------------------- | -------------------------------------------- | +|[#625](https://github.com/elastic/ansible-elasticsearch/pull/625) | [@jmlrt](https://github.com/jmlrt) | Add bumper script | +|[#575](https://github.com/elastic/ansible-elasticsearch/pull/575) | [@flyinggecko](https://github.com/flyinggecko) | Docs: Fix name of elasticsearch ansible role | +|[#629](https://github.com/elastic/ansible-elasticsearch/pull/629) | [@patsevanton](https://github.com/patsevanton) | Add cluster.initial_master_nodes | +|[#620](https://github.com/elastic/ansible-elasticsearch/pull/620) | [@pemontto](https://github.com/pemontto) | Add SSL/TLS support | +|[#630](https://github.com/elastic/ansible-elasticsearch/pull/630) | [@jmlrt](https://github.com/jmlrt) | Indent yaml for config file | +|[#636](https://github.com/elastic/ansible-elasticsearch/pull/636) | [@jmlrt](https://github.com/jmlrt) | Bump elasticsearch to 6.8.5 and 7.4.2 | +|[#637](https://github.com/elastic/ansible-elasticsearch/pull/637) | [@jmlrt](https://github.com/jmlrt) | Use default config files | + + ## 7.4.1 - 2019/10/23 * 7.4.1 as default version diff --git a/README.md b/README.md index 22c815a..1defec8 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,29 @@ The latest Elasticsearch versions of 7.x & 6.x are actively tested. * If you install more than one instance of Elasticsearch on the same host (with different ports, directory and config files), **do not update to ansible-elasticsearch >= 7.1.1**, please follow this [workaround](./docs/multi-instance.md#workaround) instead. * For multi-instances use cases, we are now recommending Docker containers using our official images (https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html). +### Removing the MAX_THREAD settings + +Ansible-elasticsearch 7.5.0 is removing the option to customize the maximum number of threads the process can start in [#637](https://github.com/elastic/ansible-elasticsearch/pull/637/files#diff-04c6e90faac2675aa89e2176d2eec7d8L408). +We discovered that this option wasn't working anymore since multi-instance support removal in ansible-elasticsearch 7.1.1. +This option will be added back in a following release if it's still relevant regarding latest Elasticsearch evolutions. + +### Changes about configuration files + +Ansible-elasticsearch 7.5.0 is updating the configuration files provided by this role in [#637](https://github.com/elastic/ansible-elasticsearch/pull/637) which contained some otions deprecated in 6.x and 7.x: +- `/etc/default/elasticsearch`|`/etc/sysconfig/elasticsearch`: the new template reflect the configuration file provided by Elasticsearch >= 6.x, the parameter we removed were already not used in 6.x and 7.x +- `/etc/elasticsearch/jvm.options`: the new template reflect the configuration files provided by Elasticsearch >= 6.x +- `/etc/elasticsearch/log4j2.properties`: + - We removed `log4j2.properties.j2` template from this Ansible role as it was a static file not bringing any customization specific to some ansible variable. + - Deployment of this Ansible role on new servers will get the default `log4j2.properties` provided by Elastisearch without any override. + - **WARNING**: For upgrade scenarios where this file was already managed by previous versions of ansible-elasticsearch, this file will become unmanaged and won't be updated by default. If you wish to update it to 7.5 version, you can retrieve it [here](https://github.com/elastic/elasticsearch/blob/7.5/distribution/src/config/log4j2.properties) and use this file with `es_config_log4j2` Ansible variable (see below). + +#### How to override configuration files provided by ansible-elasticsearch? + +You can now override the configuration files with your own versions by using the following Ansible variables: +- `es_config_default: "elasticsearch.j2"`: replace `elasticsearch.j2` by your own template to use a custom `/etc/default/elasticsearch`|`/etc/sysconfig/elasticsearch` configuration file +- `es_config_jvm: "jvm.options.j2"`: replace `jvm.options.j2` by your own template to use a custom `/etc/elasticsearch/jvm.options` configuration file +- `es_config_log4j2: ""`: set this variable to the path of your own template to use a custom `/etc/elasticsearch/log4j2.properties` configuration file + ## Dependency This role uses the json_query filter which [requires jmespath](https://github.com/ansible/ansible/issues/24319) on the local machine.