elastic / ansible-elasticsearch

Ansible playbook for Elasticsearch
Other
1.59k stars 857 forks source link

Tag 6.6.0 is not compatible with Ansible 2.10 #735

Closed hueneburg closed 3 years ago

hueneburg commented 3 years ago

Elasticsearch version 6.6.0

Role version: (If using master please specify github sha) 6.6.0

JVM version (java -version): ~1.8.0_121~ 1.8.0_262

OS version (uname -a if on a Unix-like system): Linux localhost.localdomain 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behaviour: the x | version_compare('version', 'operator') was removed somewhere between Ansible 2.5 (point of deprecation) and 2.10. The new version is x is version('version', 'operator').

I've created a patch but I can't create a PR for tags, so I'm doing it this way: https://github.com/hueneburg/ansible-elasticsearch/commit/b0dd1239d26d4986682efbf7e871893345e1d5ee. It works locally.

It would be great if you could create a new tag (for example 6.6.0-ansible2.10 or so).

Playbook: Please specify the full playbook used to reproduce this issue.

Any with ansible version 2.10

Provide logs from Ansible: fatal: [shop-search-master-beta]: FAILED! => {"msg": "The conditional check 'es_version | version_compare('6.3.0', '<')' failed. The error was: template error while templating string: no filter named 'version_compare'. String: {% if es_version | version_compare('6.3.0', '<') %} True {% else %} False {% endif %}\n\nThe error appears to be in '/Users/JP23647/IdeaProjects/ansible-playbook/roles/elasticsearch/tasks/compatibility-variables.yml': line 21, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Detect if es_version is before X-Pack was open and included\n ^ here\n"}

ES Logs if relevant: not relevant

jmlrt commented 3 years ago

Hi @hueneburg, Our policy is to create a tag only when releasing a new version of the role. That's why we won't retag 6.6.0 or add a new 6.6.0-ansible2.10 tag.

In addidion, Elasticsearch 6.6.0 isn't supported anymore, and I would highly recommend you to migrate to 6.8.13 or 7.9.3 instead.

That said, you can also use the latest version of the role (7.9.3 currently) with an older version of Elasticsearch by overriding es_version Ansible variable. This is tested by our CI with Elasticsearch 6.8.13 and multiple versions of Ansible including 2.10 and I did a quick test with Elasticsearch 6.6.0 and Ansible 2.10.2 which was OK if upgrading Elasticsearch is really not an option.

jmlrt commented 3 years ago

I'm closing the issue, don't hesitate to comment if you have any question.

hueneburg commented 3 years ago

Just an FYI: upgrading the playbook is not really efficient and we are planning to upgrade to elasticsearch 7.x but that takes time. The ansible upgrade is required for some modules for other tasks, so our plan is the following:

jmlrt commented 3 years ago

I'm curious why upgrading the role isn't really efficient.

However, if upgrading the role or Elasticsearch version isn't an option, using a fork with your change is the best option 👍

hueneburg commented 3 years ago

Because we'd need to test the new role extensively, in case we have an outage and discover some issue. And since we want to upgrade to 7.x soon-ish anyway, testing that role just to replace it with a newer one doesn't really make sense.