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
# 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
2018-06-14 16:33:40 +02:00
es_users_path : "users"
es_xpack_conf_subdir : ""
2018-06-14 14:44:31 +02:00
es_repo_name : "{{ es_major_version }}"
es_xpack_users_command : "elasticsearch-users"
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
- name : Detect if es_version is before X-Pack was open and included
set_fact :
es_open_xpack : false
2018-12-27 22:47:24 +01:00
when : "es_version is version_compare('6.3.0', '<')"
2018-06-14 14:44:31 +02:00
2019-03-27 16:29:22 +00:00
- name : If this is an older version we need to install X-Pack as a plugin and use a different users command
2018-06-14 14:44:31 +02:00
set_fact :
es_install_xpack : true
es_xpack_users_command : "x-pack/users"
2018-06-14 16:33:40 +02:00
es_xpack_conf_subdir : "/x-pack"
2019-10-11 17:16:35 +01:00
when :
2018-06-14 14:44:31 +02:00
- 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 }}"
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 :
- es_open_xpack
- not es_enable_xpack
2019-10-11 17:16:35 +01:00
- name : Set the URL scheme based if http ssl/tls is enabled
set_fact :
es_api_scheme : "https"
when : es_enable_http_ssl