forked from elastic/ansible-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompatibility-variables.yml
38 lines (34 loc) · 1.77 KB
/
compatibility-variables.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
# 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/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
- 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"
- 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 }}"
es_package_name: "elasticsearch"
es_other_package_name: "elasticsearch-oss"
es_other_repo_name: "{{ 'oss-' + es_major_version }}"
es_other_apt_url: "deb {{ es_repo_base }}/packages/{{ 'oss-' + es_major_version }}/apt stable main"
- name: Use the oss repo and package
set_fact:
es_repo_name: "{{ 'oss-' + es_major_version }}"
es_other_repo_name: "{{ es_major_version }}"
es_other_apt_url: "deb {{ es_repo_base }}/packages/{{ es_major_version }}/apt stable main"
es_package_name: "elasticsearch-oss"
es_other_package_name: "elasticsearch"
when:
- oss_version
- name: Set the URL scheme to https if SSL/TLS is enabled
set_fact:
es_api_scheme: "https"
when: es_enable_http_ssl | bool