2018-06-14 14:44:31 +02:00
---
# 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
2021-10-18 11:38:17 -05:00
# can be seen in our the https://github.com/elastic/ansible-elasticsearch/blob/main/test/integration/xpack.yml
# integration test and in the Multi Node server documentation examples https://github.com/elastic/ansible-elasticsearch/blob/main/test/integration/xpack.yml
2020-06-12 18:15:03 +02:00
- name : Set backward compatibility for deprecated es_enable_xpack variable
when : es_enable_xpack is defined and not es_enable_xpack
block :
- name : Set fact oss_version when using es_enable_xpack
set_fact : oss_version=true
- name : Warn about deprecated es_enable_xpack variable
debug :
msg : "WARNING: es_enable_xpack variable is now deprecated. You should use oss_version instead"
2018-06-14 14:44:31 +02:00
- name : Set the defaults here otherwise they can't be overriden in the same play if the role is called twice
set_fact :
es_repo_name : "{{ es_major_version }}"
2019-05-09 09:06:02 +02:00
es_package_name : "elasticsearch"
2018-12-27 16:42:14 +01:00
es_other_package_name : "elasticsearch-oss"
2018-12-31 17:28:37 +01:00
es_other_repo_name : "{{ 'oss-' + es_major_version }}"
2019-01-16 16:11:51 -05:00
es_other_apt_url : "deb {{ es_repo_base }}/packages/{{ 'oss-' + es_major_version }}/apt stable main"
2018-06-14 14:44:31 +02:00
2020-06-12 18:15:03 +02:00
- name : Use the oss repo and package
2018-06-14 14:44:31 +02:00
set_fact :
es_repo_name : "{{ 'oss-' + es_major_version }}"
2018-12-31 17:28:37 +01:00
es_other_repo_name : "{{ es_major_version }}"
2019-01-16 16:11:51 -05:00
es_other_apt_url : "deb {{ es_repo_base }}/packages/{{ es_major_version }}/apt stable main"
2018-06-14 14:44:31 +02:00
es_package_name : "elasticsearch-oss"
2018-12-27 16:42:14 +01:00
es_other_package_name : "elasticsearch"
2018-06-14 14:44:31 +02:00
when :
2020-06-12 18:15:03 +02:00
- oss_version
2019-10-11 17:16:35 +01:00
2019-10-12 00:03:47 +01:00
- name : Set the URL scheme to https if SSL/TLS is enabled
2019-10-11 17:16:35 +01:00
set_fact :
es_api_scheme : "https"
2019-10-12 00:03:47 +01:00
when : es_enable_http_ssl | bool