xpack features refactoring (#653)
- rename es_enable_xpack variable to oss_version this variable name should be more explicit and consistent with the xpack changes made in 6.3 es_enable_xpack can still be used but is deprecated and will be removed in a later version. - remove es_xpack-features variables this variable was not working anymore since 6.3 [0] [0]: https://github.com/elastic/ansible-elasticsearch/issues/608
This commit is contained in:
parent
c12542836e
commit
cab03ece10
14 changed files with 31 additions and 74 deletions
|
|
@ -5,6 +5,14 @@
|
|||
# 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 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:
|
||||
|
|
@ -14,7 +22,7 @@
|
|||
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 if xpack is not being used
|
||||
- name: Use the oss repo and package
|
||||
set_fact:
|
||||
es_repo_name: "{{ 'oss-' + es_major_version }}"
|
||||
es_other_repo_name: "{{ es_major_version }}"
|
||||
|
|
@ -22,7 +30,7 @@
|
|||
es_package_name: "elasticsearch-oss"
|
||||
es_other_package_name: "elasticsearch"
|
||||
when:
|
||||
- not es_enable_xpack
|
||||
- oss_version
|
||||
|
||||
- name: Set the URL scheme to https if SSL/TLS is enabled
|
||||
set_fact:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
# Check for mandatory parameters
|
||||
|
||||
- name: Warn about deprecated es_xpack_features variable
|
||||
debug:
|
||||
msg: "WARNING: es_xpack_features variable is now deprecated. All feature are now enabled by default"
|
||||
when: es_xpack_features is defined and not oss_version
|
||||
|
||||
- name: fail when es_proxy_port is not defined or is blank
|
||||
fail: msg="es_proxy_port must be specified and cannot be blank when es_proxy_host is defined"
|
||||
when: (es_proxy_port is not defined or es_proxy_port == '') and (es_proxy_host is defined and es_proxy_host != '')
|
||||
|
|
@ -13,8 +18,8 @@
|
|||
- name: fail when api credentials are not declared when using security
|
||||
fail: msg="Enabling security requires an es_api_basic_auth_username and es_api_basic_auth_password to be provided to allow cluster operations"
|
||||
when:
|
||||
- es_enable_xpack and "security" in es_xpack_features
|
||||
- es_api_basic_auth_username is not defined
|
||||
- not oss_version
|
||||
- es_api_basic_auth_username is defined
|
||||
- es_api_basic_auth_password is not defined
|
||||
|
||||
- name: fail when ssl enabled without defining a key and certificate
|
||||
|
|
@ -38,4 +43,3 @@
|
|||
|
||||
- name: set fact use_system_d
|
||||
set_fact: use_system_d={{(ansible_distribution == 'Debian' and ansible_distribution_version is version('8', '>=')) or (ansible_distribution in ['RedHat','CentOS'] and ansible_distribution_version is version('7', '>=')) or (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('15', '>=')) }}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@
|
|||
set_fact: manage_native_realm=true
|
||||
when:
|
||||
- es_start_service
|
||||
- es_enable_xpack
|
||||
- not oss_version
|
||||
- (es_users is defined and es_users.native is defined) or (es_roles is defined and es_roles.native is defined)
|
||||
|
||||
# If playbook runs too fast, Native commands could fail as the Native Realm is not yet up
|
||||
|
|
@ -88,11 +88,11 @@
|
|||
|
||||
- name: activate-license
|
||||
include: ./xpack/security/elasticsearch-xpack-activation.yml
|
||||
when: es_start_service and es_enable_xpack and es_xpack_license is defined and es_xpack_license != ''
|
||||
when: es_start_service and not oss_version and es_xpack_license is defined and es_xpack_license != ''
|
||||
|
||||
- name: activate-trial
|
||||
include: ./xpack/security/elasticsearch-xpack-trial-activation.yml
|
||||
when: es_start_service and es_enable_xpack and es_xpack_trial
|
||||
when: es_start_service and not oss_version and es_xpack_trial
|
||||
|
||||
#perform security actions here now elasticsearch is started
|
||||
- name: include xpack/security/elasticsearch-security-native.yml
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#Security configuration
|
||||
- name: include security/elasticsearch-security.yml
|
||||
include: security/elasticsearch-security.yml
|
||||
when: es_enable_xpack
|
||||
when: not oss_version
|
||||
|
||||
#Make sure elasticsearch.keystore has correct Permissions
|
||||
- name: Set elasticsearch.keystore Permissions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue