From 29be2ab5e61835fd305bc89e940893daecea49c1 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Wed, 8 Dec 2021 18:13:18 +0100 Subject: [PATCH 01/10] README: fix link to ES licensing change blog post (#830) Co-authored-by: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e68c0d2..2421b57 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Starting from Elasticsearch 7.11.0, OSS distributions will no longer be provided This Ansible role will fail if `oss_version` is set to `true` and `es_version` is greater than `7.11.0`. -See [Doubling down on open, Part II](https://www.elastic.co/blog/licensing-change for more details) +See [Doubling down on open, Part II](https://www.elastic.co/blog/licensing-change) blog post for more details. #### How to override configuration files provided by ansible-elasticsearch? From d83e5b88ece03ddf4a412a93c7cbb5ce584e201a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20Gr=C3=A9au?= Date: Wed, 8 Dec 2021 19:58:00 -0500 Subject: [PATCH 02/10] Add warning message about 8.x versions (#838) This commit adds a warning message to the README to notify users that the role will be deprecated. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2421b57..b61518b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![Build Status](https://img.shields.io/jenkins/s/https/devops-ci.elastic.co/job/elastic+ansible-elasticsearch+main.svg)](https://devops-ci.elastic.co/job/elastic+ansible-elasticsearch+main/) [![Ansible Galaxy](https://img.shields.io/badge/ansible--galaxy-elastic.elasticsearch-blue.svg)](https://galaxy.ansible.com/elastic/elasticsearch/) +⚠️ **This Ansible role is being deprecated and will not be updated to support Elasticsearch 8.0.0 and the following versions.** + **THIS ROLE IS FOR 7.x & 6.x** Ansible role for 7.x/6.x Elasticsearch. Currently this works on Debian and RedHat based linux systems. Tested platforms are: From 22d0dbd257081c0bc20866f24be8aa0c49ee0928 Mon Sep 17 00:00:00 2001 From: Nassim Kammah Date: Tue, 14 Dec 2021 12:22:31 +0100 Subject: [PATCH 03/10] 7.16.1 release (#840) Co-authored-by: Elastic Machine --- .kitchen.yml | 2 +- CHANGELOG.md | 14 ++++++++++++++ README.md | 10 +++++----- defaults/main.yml | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index ac8eb77..635d4a5 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -22,7 +22,7 @@ provisioner: extra_vars: es_major_version: "<%= ENV['VERSION'] %>" <% if ENV['VERSION'] == '6.x' %> - es_version: '6.8.18' + es_version: '6.8.21' <% end %> <% end %> diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d21bb0..566e7a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 7.16.1 + +* 7.16.1 as default version. +* 6.8.21 as 6.x tested version + + +| PR | Author | Title | +| --- | --- | --- | +| [#838](https://github.com/elastic/ansible-elasticsearch/pull/838) | [@mgreau](https://github.com/mgreau) | Add warning message about 8.x versions | +| [#830](https://github.com/elastic/ansible-elasticsearch/pull/830) | [@bfontaine](https://github.com/bfontaine) | README: fix link to ES licensing change blog post | +| [#831](https://github.com/elastic/ansible-elasticsearch/pull/831) | [@gaima8](https://github.com/gaima8) | command necessarily causes a change on each invocation breaking idempotency, wait_for accomplishes the same goal without the change | +| [#833](https://github.com/elastic/ansible-elasticsearch/pull/833) | [@Pablohn26](https://github.com/Pablohn26) | Fix broken link | + + ## 7.16.0 * 7.16.0 as default version. diff --git a/README.md b/README.md index b61518b..7d0f631 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,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,v7.16.0 +ansible-galaxy install elastic.elasticsearch,v7.16.1 ``` Then create your playbook yaml adding the role elasticsearch. @@ -84,14 +84,14 @@ The simplest configuration therefore consists of: roles: - role: elastic.elasticsearch vars: - es_version: 7.16.0 + es_version: 7.16.1 ``` -The above installs Elasticsearch 7.16.0 in a single node 'node1' on the hosts 'localhost'. +The above installs Elasticsearch 7.16.1 in a single node 'node1' on the hosts 'localhost'. **Note**: Elasticsearch default version is described in [`es_version`](https://github.com/elastic/ansible-elasticsearch/blob/main/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.16.0](https://github.com/elastic/ansible-elasticsearch/blob/main/defaults/main.yml#L2) and [6.8.18](https://github.com/elastic/ansible-elasticsearch/blob/main/.kitchen.yml#L22) at the time of writing), this role should work with other versions also in most cases. +While we are testing this role only with one 7.x and one 6.x version (respectively [7.16.1](https://github.com/elastic/ansible-elasticsearch/blob/main/defaults/main.yml#L2) and [6.8.21](https://github.com/elastic/ansible-elasticsearch/blob/main/.kitchen.yml#L22) at the time of writing), this role should work with other versions also in most cases. This role also uses [Ansible tags](https://docs.ansible.com/ansible/2.9/user_guide/playbooks_tags.html). Run your playbook with the `--list-tasks` flag for more information. @@ -423,7 +423,7 @@ In addition to es_config, the following parameters allow the customization of th * ```oss_version``` Default `false`. Setting this to `true` will install the oss release of Elasticsearch (for version <7.11.0 only). * `es_xpack_trial` Default `false`. Setting this to `true` will start the 30-day trail once the cluster starts. -* ```es_version``` (e.g. "7.16.0"). +* ```es_version``` (e.g. "7.16.1"). * ```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 4b3d1f8..d5c1fd1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ --- -es_version: "7.16.0" +es_version: "7.16.1" es_use_snapshot_release: false oss_version: false es_package_name: "elasticsearch" From f3a389e8ba9f837dd968f9ca4e22753f48c59eb1 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 20 Dec 2021 12:10:48 -0800 Subject: [PATCH 04/10] 7.16.2 release (#842) --- .kitchen.yml | 2 +- CHANGELOG.md | 5 +++++ README.md | 10 +++++----- defaults/main.yml | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 635d4a5..46ab4e1 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -22,7 +22,7 @@ provisioner: extra_vars: es_major_version: "<%= ENV['VERSION'] %>" <% if ENV['VERSION'] == '6.x' %> - es_version: '6.8.21' + es_version: '6.8.22' <% end %> <% end %> diff --git a/CHANGELOG.md b/CHANGELOG.md index 566e7a2..e84bb02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 7.16.2 + +* 7.16.2 as default version. +* 6.8.22 as 6.x tested version + ## 7.16.1 * 7.16.1 as default version. diff --git a/README.md b/README.md index 7d0f631..3d4dfad 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,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,v7.16.1 +ansible-galaxy install elastic.elasticsearch,v7.16.2 ``` Then create your playbook yaml adding the role elasticsearch. @@ -84,14 +84,14 @@ The simplest configuration therefore consists of: roles: - role: elastic.elasticsearch vars: - es_version: 7.16.1 + es_version: 7.16.2 ``` -The above installs Elasticsearch 7.16.1 in a single node 'node1' on the hosts 'localhost'. +The above installs Elasticsearch 7.16.2 in a single node 'node1' on the hosts 'localhost'. **Note**: Elasticsearch default version is described in [`es_version`](https://github.com/elastic/ansible-elasticsearch/blob/main/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.16.1](https://github.com/elastic/ansible-elasticsearch/blob/main/defaults/main.yml#L2) and [6.8.21](https://github.com/elastic/ansible-elasticsearch/blob/main/.kitchen.yml#L22) at the time of writing), this role should work with other versions also in most cases. +While we are testing this role only with one 7.x and one 6.x version (respectively [7.16.2](https://github.com/elastic/ansible-elasticsearch/blob/main/defaults/main.yml#L2) and [6.8.22](https://github.com/elastic/ansible-elasticsearch/blob/main/.kitchen.yml#L22) at the time of writing), this role should work with other versions also in most cases. This role also uses [Ansible tags](https://docs.ansible.com/ansible/2.9/user_guide/playbooks_tags.html). Run your playbook with the `--list-tasks` flag for more information. @@ -423,7 +423,7 @@ In addition to es_config, the following parameters allow the customization of th * ```oss_version``` Default `false`. Setting this to `true` will install the oss release of Elasticsearch (for version <7.11.0 only). * `es_xpack_trial` Default `false`. Setting this to `true` will start the 30-day trail once the cluster starts. -* ```es_version``` (e.g. "7.16.1"). +* ```es_version``` (e.g. "7.16.2"). * ```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 d5c1fd1..47ffe90 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ --- -es_version: "7.16.1" +es_version: "7.16.2" es_use_snapshot_release: false oss_version: false es_package_name: "elasticsearch" From f653b3eed2984ea655d04d4e42283936ab581a71 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Thu, 13 Jan 2022 15:09:35 -0700 Subject: [PATCH 05/10] 7.16.3 release (#844) --- .kitchen.yml | 2 +- CHANGELOG.md | 5 +++++ README.md | 10 +++++----- defaults/main.yml | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 46ab4e1..15af7cf 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -22,7 +22,7 @@ provisioner: extra_vars: es_major_version: "<%= ENV['VERSION'] %>" <% if ENV['VERSION'] == '6.x' %> - es_version: '6.8.22' + es_version: '6.8.23' <% end %> <% end %> diff --git a/CHANGELOG.md b/CHANGELOG.md index e84bb02..acb9d98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 7.16.3 + +* 7.16.3 as default version. +* 6.8.23 as 6.x tested version + ## 7.16.2 * 7.16.2 as default version. diff --git a/README.md b/README.md index 3d4dfad..ff23d37 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,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,v7.16.2 +ansible-galaxy install elastic.elasticsearch,v7.16.3 ``` Then create your playbook yaml adding the role elasticsearch. @@ -84,14 +84,14 @@ The simplest configuration therefore consists of: roles: - role: elastic.elasticsearch vars: - es_version: 7.16.2 + es_version: 7.16.3 ``` -The above installs Elasticsearch 7.16.2 in a single node 'node1' on the hosts 'localhost'. +The above installs Elasticsearch 7.16.3 in a single node 'node1' on the hosts 'localhost'. **Note**: Elasticsearch default version is described in [`es_version`](https://github.com/elastic/ansible-elasticsearch/blob/main/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.16.2](https://github.com/elastic/ansible-elasticsearch/blob/main/defaults/main.yml#L2) and [6.8.22](https://github.com/elastic/ansible-elasticsearch/blob/main/.kitchen.yml#L22) at the time of writing), this role should work with other versions also in most cases. +While we are testing this role only with one 7.x and one 6.x version (respectively [7.16.3](https://github.com/elastic/ansible-elasticsearch/blob/main/defaults/main.yml#L2) and [6.8.23](https://github.com/elastic/ansible-elasticsearch/blob/main/.kitchen.yml#L22) at the time of writing), this role should work with other versions also in most cases. This role also uses [Ansible tags](https://docs.ansible.com/ansible/2.9/user_guide/playbooks_tags.html). Run your playbook with the `--list-tasks` flag for more information. @@ -423,7 +423,7 @@ In addition to es_config, the following parameters allow the customization of th * ```oss_version``` Default `false`. Setting this to `true` will install the oss release of Elasticsearch (for version <7.11.0 only). * `es_xpack_trial` Default `false`. Setting this to `true` will start the 30-day trail once the cluster starts. -* ```es_version``` (e.g. "7.16.2"). +* ```es_version``` (e.g. "7.16.3"). * ```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 47ffe90..a0c3c41 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ --- -es_version: "7.16.2" +es_version: "7.16.3" es_use_snapshot_release: false oss_version: false es_package_name: "elasticsearch" From 532cfba2180c9403f033928e083cedc4feefadca Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Tue, 1 Feb 2022 15:51:40 +0100 Subject: [PATCH 06/10] Remove CentOS 8 tests (#845) This commit removes CentOS 8 tests. These tests are now failing because CentOS 8 is now EOL and it's repositories have been archived. Source: https://forums.centos.org/viewtopic.php?f=54&t=78708 --- README.md | 1 - test/matrix-6x.yml | 1 - test/matrix.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/README.md b/README.md index ff23d37..caa7a5a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ Ansible role for 7.x/6.x Elasticsearch. Currently this works on Debian and RedH * Debian 9 * Debian 10 * CentOS 7 -* CentOS 8 * Amazon Linux 2 The latest Elasticsearch versions of 7.x & 6.x are actively tested. diff --git a/test/matrix-6x.yml b/test/matrix-6x.yml index c92f941..d76a5cc 100644 --- a/test/matrix-6x.yml +++ b/test/matrix-6x.yml @@ -6,7 +6,6 @@ OS: - debian-9 - debian-10 - centos-7 - - centos-8 - amazonlinux-2 TEST_TYPE: - custom-config diff --git a/test/matrix.yml b/test/matrix.yml index 21538e6..1955cf5 100644 --- a/test/matrix.yml +++ b/test/matrix.yml @@ -6,7 +6,6 @@ OS: - debian-9 - debian-10 - centos-7 - - centos-8 - amazonlinux-2 TEST_TYPE: - custom-config From 5363b3fde12b198156f35bc4811bb3f933ab4b28 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Tue, 1 Feb 2022 09:28:16 -0700 Subject: [PATCH 07/10] 7.17.0 release (#846) --- CHANGELOG.md | 10 ++++++++++ README.md | 10 +++++----- defaults/main.yml | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acb9d98..efa5c6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 7.17.0 + +* 7.17.0 as default version. + + +| PR | Author | Title | +| --- | --- | --- | +| [#845](https://github.com/elastic/ansible-elasticsearch/pull/845) | [@jmlrt](https://github.com/jmlrt) | Remove CentOS 8 tests | + + ## 7.16.3 * 7.16.3 as default version. diff --git a/README.md b/README.md index caa7a5a..02848f7 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,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,v7.16.3 +ansible-galaxy install elastic.elasticsearch,v7.17.0 ``` Then create your playbook yaml adding the role elasticsearch. @@ -83,14 +83,14 @@ The simplest configuration therefore consists of: roles: - role: elastic.elasticsearch vars: - es_version: 7.16.3 + es_version: 7.17.0 ``` -The above installs Elasticsearch 7.16.3 in a single node 'node1' on the hosts 'localhost'. +The above installs Elasticsearch 7.17.0 in a single node 'node1' on the hosts 'localhost'. **Note**: Elasticsearch default version is described in [`es_version`](https://github.com/elastic/ansible-elasticsearch/blob/main/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.16.3](https://github.com/elastic/ansible-elasticsearch/blob/main/defaults/main.yml#L2) and [6.8.23](https://github.com/elastic/ansible-elasticsearch/blob/main/.kitchen.yml#L22) at the time of writing), this role should work with other versions also in most cases. +While we are testing this role only with one 7.x and one 6.x version (respectively [7.17.0](https://github.com/elastic/ansible-elasticsearch/blob/main/defaults/main.yml#L2) and [6.8.23](https://github.com/elastic/ansible-elasticsearch/blob/main/.kitchen.yml#L22) at the time of writing), this role should work with other versions also in most cases. This role also uses [Ansible tags](https://docs.ansible.com/ansible/2.9/user_guide/playbooks_tags.html). Run your playbook with the `--list-tasks` flag for more information. @@ -422,7 +422,7 @@ In addition to es_config, the following parameters allow the customization of th * ```oss_version``` Default `false`. Setting this to `true` will install the oss release of Elasticsearch (for version <7.11.0 only). * `es_xpack_trial` Default `false`. Setting this to `true` will start the 30-day trail once the cluster starts. -* ```es_version``` (e.g. "7.16.3"). +* ```es_version``` (e.g. "7.17.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 a0c3c41..47c9479 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ --- -es_version: "7.16.3" +es_version: "7.17.0" es_use_snapshot_release: false oss_version: false es_package_name: "elasticsearch" From ff5f1b3ad1e39c519477a2ae944f48c8e141661a Mon Sep 17 00:00:00 2001 From: mgreau Date: Wed, 2 Feb 2022 18:00:28 -0500 Subject: [PATCH 08/10] Add archived notice to README explaining alternative options --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 02848f7..342944c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,17 @@ +# ARCHIVED + +This project is no longer maintained. For alternative getting started +experiences, you may want to try one of these options: + +- Start a [free trial on Elastic Cloud](https://www.elastic.co/cloud/elasticsearch-service/signup), our hosted service. +- Take a look at [Elastic Cloud on Kubernetes (ECK)](https://elastic.co/guide/en/cloud-on-k8s/current/k8s-quickstart.html) for launching the stack via Kubernetes. +- Read our [Running the Elastic Stack on Docker](https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html) guide. +- Take a look at the [Elastic Stack Terraform provider.](https://github.com/elastic/terraform-provider-elasticstack) + # ansible-elasticsearch [![Build Status](https://img.shields.io/jenkins/s/https/devops-ci.elastic.co/job/elastic+ansible-elasticsearch+main.svg)](https://devops-ci.elastic.co/job/elastic+ansible-elasticsearch+main/) [![Ansible Galaxy](https://img.shields.io/badge/ansible--galaxy-elastic.elasticsearch-blue.svg)](https://galaxy.ansible.com/elastic/elasticsearch/) -⚠️ **This Ansible role is being deprecated and will not be updated to support Elasticsearch 8.0.0 and the following versions.** **THIS ROLE IS FOR 7.x & 6.x** From af05c6470ef63337deba7009eec6af3ea05e2193 Mon Sep 17 00:00:00 2001 From: Nassim Kammah Date: Fri, 24 Jun 2022 06:41:26 +0200 Subject: [PATCH 09/10] Add docs on running the role with 8.X (#847) * Add doc on 8.x support * Updating top level readme --- README.md | 14 +++--- docs/8x-support.md | 116 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 7 deletions(-) create mode 100644 docs/8x-support.md diff --git a/README.md b/README.md index 342944c..182cdae 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # ARCHIVED -This project is no longer maintained. For alternative getting started -experiences, you may want to try one of these options: +This project is no longer maintained. + +You are welcomed to keep using it and adapting it to work for your own needs, including with Elasticsearch [8.x](docs/8x-support.md). + +For alternative getting started experiences, you may want to try one of these options: - Start a [free trial on Elastic Cloud](https://www.elastic.co/cloud/elasticsearch-service/signup), our hosted service. - Take a look at [Elastic Cloud on Kubernetes (ECK)](https://elastic.co/guide/en/cloud-on-k8s/current/k8s-quickstart.html) for launching the stack via Kubernetes. @@ -9,13 +12,12 @@ experiences, you may want to try one of these options: - Take a look at the [Elastic Stack Terraform provider.](https://github.com/elastic/terraform-provider-elasticstack) # ansible-elasticsearch -[![Build Status](https://img.shields.io/jenkins/s/https/devops-ci.elastic.co/job/elastic+ansible-elasticsearch+main.svg)](https://devops-ci.elastic.co/job/elastic+ansible-elasticsearch+main/) [![Ansible Galaxy](https://img.shields.io/badge/ansible--galaxy-elastic.elasticsearch-blue.svg)](https://galaxy.ansible.com/elastic/elasticsearch/) -**THIS ROLE IS FOR 7.x & 6.x** +**THIS ROLE IS FOR 7.x & 6.x**, but should still work with 8.x (see [note](docs/8x-support.md)). -Ansible role for 7.x/6.x Elasticsearch. Currently this works on Debian and RedHat based linux systems. Tested platforms are: +Ansible role for 7.x/6.x Elasticsearch - tests used to run and pass on the below platforms: * Ubuntu 16.04 * Ubuntu 18.04 @@ -26,8 +28,6 @@ Ansible role for 7.x/6.x Elasticsearch. Currently this works on Debian and RedH * CentOS 7 * Amazon Linux 2 -The latest Elasticsearch versions of 7.x & 6.x are actively tested. - ## BREAKING CHANGES ### Notice about multi-instance support diff --git a/docs/8x-support.md b/docs/8x-support.md new file mode 100644 index 0000000..9e8d980 --- /dev/null +++ b/docs/8x-support.md @@ -0,0 +1,116 @@ +# 8.x support + +In [December 2021](https://github.com/elastic/ansible-elasticsearch/pull/838), we made the hard decision to deprecate this Ansible playbook without adding support for Elasticsearch 8.X. +We acknowledge the impact this has had on many developers and organizations, and while we are not reverting the decision, we decided to share some guidelines around how to proceed from here, for folks wanting to keep using this playbook with Elasticsearch 8.X. + +--- + +At a high level, this role is expected to work in most cases for fresh installs and upgrades from 7.17+ by only overriding the `es_version` variable as long as the security is enforced properly using the [SSL/TLS doc](ssl-tls-setup.md). + +1. install the last released version of the role from galaxy: `ansible-galaxy install elastic.elasticsearch,v7.17.0` + +2. copy the TLS PKCS12 keystore and truststore (https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#security-http-pkcs12-files) + +3. write a minimal playbook to deploy 8.2.3 on localhost: +```yaml +- hosts: localhost + roles: + - elastic.elasticsearch + vars: + es_version: 8.2.3 + es_api_basic_auth_username: elastic + es_api_basic_auth_password: changeme + es_enable_http_ssl: true + es_enable_transport_ssl: true + es_ssl_keystore: "certs/keystore-password.p12" + es_ssl_truststore: "certs/truststore-password.p12" + es_ssl_keystore_password: password1 + es_ssl_truststore_password: password2 + es_validate_certs: no +``` + +4. deploy locally: `ansible-playbook es.yml` + +## Context for the below experiment + +The intent is to assess if the current playbook can still work with ES 8.X and what modifications may be needed. The testing was done on Ubuntu 20.04 and CentOS7 GCP VMs. + +The only code change done in the Ansible playbook was the override of the `es_version` variable. + +### What is working + +- ✅ Deploying a standalone Elasticsearch cluster in 8.2.3 with the security example playbook from 7.x: +- ✅ managing Elasticsearch users +- ✅ upgrading a 7.17.0 standalone cluster **with security already enabled** to 8.2.3 +- ✅ managing Elasticsearch license + +The below configuration was used in the tests + +```yaml +- hosts: localhost + roles: + - elastic.elasticsearch + vars: + es_config: + xpack.security.authc.realms.file.file1.order: 0 + es_api_basic_auth_username: elastic + es_api_basic_auth_password: changeme + es_api_sleep: 5 + es_enable_http_ssl: true + es_enable_transport_ssl: true + es_ssl_keystore: "test/integration/files/certs/keystore-password.p12" + es_ssl_truststore: "test/integration/files/certs/truststore-password.p12" + es_ssl_keystore_password: password1 + es_ssl_truststore_password: password2 + es_validate_certs: no + es_users: + file: + es_admin: + password: changeMe + roles: + - admin + testUser: + password: changeMeAlso! + roles: + - power_user + - user + es_roles: + file: + admin: + cluster: + - all + indices: + - names: '*' + privileges: + - all + power_user: + cluster: + - monitor + indices: + - names: '*' + privileges: + - all + user: + indices: + - names: '*' + privileges: + - read +``` + +### What is not working + +**Deploying an 8.X cluster with the default Ansible configuration (no security) will not work.** + +When runnin Elasticsearch 8.x outside of Ansible without any security configuration, Elasticsearch will autogenerate a security configuration and still activate security. +However, when you run Elasticsearch 8.x as part of the Ansible role without any security configuration, this will fail because the Ansible role will not be able to retrieve and use the autogenerated security configuration. + +To tackle this, you always have to specify your own security configuration based on the [SSL/TLS doc](ssl-tls-setup.md). + + +### What has not been tested + +**Deploying a 3 nodes cluster** + +When trying to deploy a 3 nodes clusters, the nodes seem to be configured successfully but they aren't able to communicate together with the test certificates (the ones used in automated standalone tests). It's highly likely that the problem lies with the tests certs themselves and not with the role. + +Should you be able to deploy a multi-node clusters, you will most likely have to change the configuration to use the new `node.roles` parameter ([example](https://github.com/elastic/ansible-elasticsearch/pull/772)) instead of the `node.master` and `node.data` (which got deprecated in 7.9, but the role never got [fixed](https://github.com/elastic/ansible-elasticsearch/issues/731). From a9b0d193d6bb0e534b356b61667adca5a1135811 Mon Sep 17 00:00:00 2001 From: Santeri Kainulainen Date: Fri, 7 Nov 2025 14:00:38 +0200 Subject: [PATCH 10/10] Change deprecated include to include_tasks --- tasks/elasticsearch-Debian.yml | 2 +- tasks/elasticsearch-RedHat.yml | 4 +-- tasks/elasticsearch.yml | 4 +-- tasks/main.yml | 26 +++++++++---------- tasks/xpack/elasticsearch-xpack.yml | 2 +- .../xpack/security/elasticsearch-security.yml | 2 +- test/integration/custom-config.yml | 2 +- test/integration/default.yml | 2 +- test/integration/license.yml | 2 +- test/integration/oss-to-default-upgrade.yml | 4 +-- test/integration/oss-upgrade.yml | 4 +-- test/integration/oss.yml | 2 +- test/integration/security.yml | 2 +- test/integration/trial.yml | 2 +- test/integration/upgrade.yml | 4 +-- 15 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tasks/elasticsearch-Debian.yml b/tasks/elasticsearch-Debian.yml index f6e4c17..d93e627 100644 --- a/tasks/elasticsearch-Debian.yml +++ b/tasks/elasticsearch-Debian.yml @@ -65,7 +65,7 @@ - name: Include optional user and group creation. when: (es_user_id is defined) and (es_group_id is defined) - include: elasticsearch-optional-user.yml + include_tasks: elasticsearch-optional-user.yml - name: Debian - Get installed elasticsearch version command: dpkg-query --showformat='${Version}' --show {{ es_package_name }} diff --git a/tasks/elasticsearch-RedHat.yml b/tasks/elasticsearch-RedHat.yml index 7d53fbf..e1debfc 100644 --- a/tasks/elasticsearch-RedHat.yml +++ b/tasks/elasticsearch-RedHat.yml @@ -26,7 +26,7 @@ when: es_use_repository - name: RedHat - include versionlock - include: elasticsearch-RedHat-version-lock.yml + include_tasks: elasticsearch-RedHat-version-lock.yml - name: RedHat - Remove the other elasticsearch package if switching between OSS and standard become: yes @@ -36,7 +36,7 @@ - name: Include optional user and group creation. when: (es_user_id is defined) and (es_group_id is defined) - include: elasticsearch-optional-user.yml + include_tasks: elasticsearch-optional-user.yml - name: RedHat - Install Elasticsearch become: yes diff --git a/tasks/elasticsearch.yml b/tasks/elasticsearch.yml index 05fd93b..d6e5cb7 100644 --- a/tasks/elasticsearch.yml +++ b/tasks/elasticsearch.yml @@ -1,9 +1,9 @@ --- - name: Include specific Elasticsearch - include: elasticsearch-Debian.yml + include_tasks: elasticsearch-Debian.yml when: ansible_os_family == 'Debian' - name: Include specific Elasticsearch - include: elasticsearch-RedHat.yml + include_tasks: elasticsearch-RedHat.yml when: ansible_os_family == 'RedHat' diff --git a/tasks/main.yml b/tasks/main.yml index c0ad700..855c5de 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -12,49 +12,49 @@ - always - name: set compatibility variables - include: compatibility-variables.yml + include_tasks: compatibility-variables.yml tags: - always - name: check-set-parameters - include: elasticsearch-parameters.yml + include_tasks: elasticsearch-parameters.yml tags: - always - name: use snapshot release - include: snapshot-release.yml + include_tasks: snapshot-release.yml when: es_use_snapshot_release - name: include java.yml - include: java.yml + include_tasks: java.yml when: es_java_install tags: - java - name: include elasticsearch.yml - include: elasticsearch.yml + include_tasks: elasticsearch.yml tags: - install - name: include elasticsearch-config.yml - include: elasticsearch-config.yml + include_tasks: elasticsearch-config.yml tags: - config - name: include elasticsearch-plugins.yml - include: elasticsearch-plugins.yml + include_tasks: elasticsearch-plugins.yml when: es_plugins is defined or es_plugins_reinstall tags: - plugins #We always execute xpack as we may need to remove features - name: include xpack/elasticsearch-xpack.yml - include: xpack/elasticsearch-xpack.yml + include_tasks: xpack/elasticsearch-xpack.yml tags: - xpack - name: include elasticsearch-ssl.yml - include: elasticsearch-ssl.yml + include_tasks: elasticsearch-ssl.yml when: es_enable_http_ssl or es_enable_transport_ssl tags: - xpack @@ -88,25 +88,25 @@ when: manage_native_realm | bool - name: activate-license - include: ./xpack/security/elasticsearch-xpack-activation.yml + include_tasks: ./xpack/security/elasticsearch-xpack-activation.yml when: es_start_service and not oss_version and es_xpack_license is defined and es_xpack_license != '' run_once: True - name: activate-trial - include: ./xpack/security/elasticsearch-xpack-trial-activation.yml + include_tasks: ./xpack/security/elasticsearch-xpack-trial-activation.yml when: es_start_service and not oss_version and es_xpack_trial run_once: True #perform security actions here now elasticsearch is started - name: include xpack/security/elasticsearch-security-native.yml - include: ./xpack/security/elasticsearch-security-native.yml + include_tasks: ./xpack/security/elasticsearch-security-native.yml when: manage_native_realm | bool run_once: True #Templates done after restart - handled by flushing the handlers. e.g. suppose user removes security on a running node and doesn't specify es_api_basic_auth_username and es_api_basic_auth_password. The templates will subsequently not be removed if we don't wait for the node to restart. #We also do after the native realm to ensure any changes are applied here first and its denf up. - name: include elasticsearch-template.yml - include: elasticsearch-template.yml + include_tasks: elasticsearch-template.yml when: es_templates | bool tags: - templates diff --git a/tasks/xpack/elasticsearch-xpack.yml b/tasks/xpack/elasticsearch-xpack.yml index 9b49408..84528f4 100644 --- a/tasks/xpack/elasticsearch-xpack.yml +++ b/tasks/xpack/elasticsearch-xpack.yml @@ -2,7 +2,7 @@ #Security configuration - name: include security/elasticsearch-security.yml - include: security/elasticsearch-security.yml + include_tasks: security/elasticsearch-security.yml when: not oss_version #Make sure elasticsearch.keystore has correct Permissions diff --git a/tasks/xpack/security/elasticsearch-security.yml b/tasks/xpack/security/elasticsearch-security.yml index 184ab44..1d9aee4 100644 --- a/tasks/xpack/security/elasticsearch-security.yml +++ b/tasks/xpack/security/elasticsearch-security.yml @@ -73,7 +73,7 @@ #-----------------------------FILE BASED REALM---------------------------------------- -- include: elasticsearch-security-file.yml +- include_tasks: elasticsearch-security-file.yml when: (es_users is defined and es_users.file is defined) or (es_roles is defined and es_roles.file is defined) #-----------------------------ROLE MAPPING ---------------------------------------- diff --git a/test/integration/custom-config.yml b/test/integration/custom-config.yml index ed2dbab..633f6b2 100644 --- a/test/integration/custom-config.yml +++ b/test/integration/custom-config.yml @@ -2,7 +2,7 @@ - name: Setup Elasticsearch with custom config files hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch vars: diff --git a/test/integration/default.yml b/test/integration/default.yml index 7a61d17..fb76ad1 100644 --- a/test/integration/default.yml +++ b/test/integration/default.yml @@ -2,6 +2,6 @@ - name: Setup Elasticsearch using default configuration hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch diff --git a/test/integration/license.yml b/test/integration/license.yml index cd0e234..c77e56d 100644 --- a/test/integration/license.yml +++ b/test/integration/license.yml @@ -2,7 +2,7 @@ - name: Elasticsearch Xpack HTTP different keystore and truststore with password hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch vars: diff --git a/test/integration/oss-to-default-upgrade.yml b/test/integration/oss-to-default-upgrade.yml index 774f725..8bf3112 100644 --- a/test/integration/oss-to-default-upgrade.yml +++ b/test/integration/oss-to-default-upgrade.yml @@ -2,7 +2,7 @@ - name: Deploy Elasticsearch OSS version hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch vars: @@ -12,7 +12,7 @@ - name: Upgrade to Elasticsearch default version hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch vars: diff --git a/test/integration/oss-upgrade.yml b/test/integration/oss-upgrade.yml index 153b02a..1cec4d5 100644 --- a/test/integration/oss-upgrade.yml +++ b/test/integration/oss-upgrade.yml @@ -2,7 +2,7 @@ - name: Deploy Elasticsearch OSS previous version hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch vars: @@ -12,7 +12,7 @@ - name: Deploy Elasticsearch OSS latest version hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch vars: diff --git a/test/integration/oss.yml b/test/integration/oss.yml index 6c6ba06..95f242b 100644 --- a/test/integration/oss.yml +++ b/test/integration/oss.yml @@ -2,7 +2,7 @@ - name: Setup Elasticsearch OSS 6.x hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch vars: diff --git a/test/integration/security.yml b/test/integration/security.yml index bfedebf..a00445c 100644 --- a/test/integration/security.yml +++ b/test/integration/security.yml @@ -2,7 +2,7 @@ - name: Elasticsearch Xpack HTTP different keystore and truststore with password hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch vars: diff --git a/test/integration/trial.yml b/test/integration/trial.yml index 3221713..bf253f1 100644 --- a/test/integration/trial.yml +++ b/test/integration/trial.yml @@ -2,7 +2,7 @@ - name: Setup Elasticsearch with security enabled and a trial license hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch vars: diff --git a/test/integration/upgrade.yml b/test/integration/upgrade.yml index 2a1a27b..4c6fa1a 100644 --- a/test/integration/upgrade.yml +++ b/test/integration/upgrade.yml @@ -2,7 +2,7 @@ - name: Deploy Elasticsearch previous version hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch vars: @@ -11,6 +11,6 @@ - name: Deploy Elasticsearch latest version hosts: localhost post_tasks: - - include: elasticsearch/test/integration/debug.yml + - include_tasks: elasticsearch/test/integration/debug.yml roles: - elasticsearch