Abstract 6.3 changes into a separate task to reduce all of the jinja one
liner complexity Set ES_PATH_CONF when installing so upgrading from 6.2 to 6.3 works as expected
This commit is contained in:
parent
715bd8591e
commit
bbc5e0603d
9 changed files with 52 additions and 13 deletions
35
tasks/compatibility-variables.yml
Normal file
35
tasks/compatibility-variables.yml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
|
||||
# It is possible to set these are defaults with messy jinja templating one liners however:
|
||||
# 1. That is really hard to read and debug
|
||||
# 2. When running multiple plays with the same role the defaults are not re-evaluated. An example of this
|
||||
# can be seen in our the https://github.com/elastic/ansible-elasticsearch/blob/master/test/integration/xpack.yml
|
||||
# integration test and in the Multi Node server documentation examples https://github.com/elastic/ansible-elasticsearch/blob/master/test/integration/xpack.yml
|
||||
|
||||
- name: Set the defaults here otherwise they can't be overriden in the same play if the role is called twice
|
||||
set_fact:
|
||||
es_open_xpack: true
|
||||
es_install_xpack: false
|
||||
es_repo_name: "{{ es_major_version }}"
|
||||
es_xpack_users_command: "elasticsearch-users"
|
||||
|
||||
- name: Detect if es_version is before X-Pack was open and included
|
||||
set_fact:
|
||||
es_open_xpack: false
|
||||
when: "es_version | version_compare('6.3.0', '<')"
|
||||
|
||||
- name: If this is an older version we need to install X-Pack as a plugin and use a differet users command
|
||||
set_fact:
|
||||
es_install_xpack: true
|
||||
es_xpack_users_command: "x-pack/users"
|
||||
when:
|
||||
- not es_open_xpack
|
||||
- es_enable_xpack
|
||||
|
||||
- name: Use the oss repo and package if xpack is not being used
|
||||
set_fact:
|
||||
es_repo_name: "{{ 'oss-' + es_major_version }}"
|
||||
es_package_name: "elasticsearch-oss"
|
||||
when:
|
||||
- es_open_xpack
|
||||
- not es_enable_xpack
|
||||
Loading…
Add table
Add a link
Reference in a new issue