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
|
|
@ -44,43 +44,13 @@ shared_examples 'shared::init' do |vars|
|
|||
end
|
||||
end
|
||||
describe 'xpack checks' do
|
||||
if vars['es_enable_xpack']
|
||||
it 'should be be running the xpack version' do
|
||||
if not vars['oss_version']
|
||||
it 'should be be running the basic version' do
|
||||
expect(curl_json("#{es_api_url}/_xpack", username=username, password=password)['tagline']).to eq('You know, for X')
|
||||
end
|
||||
it 'xpack should be activated' do
|
||||
expect(curl_json("#{es_api_url}/_license", username=username, password=password)['license']['status']).to eq('active')
|
||||
end
|
||||
if vars.key?('es_xpack_features')
|
||||
curl_json("#{es_api_url}/_xpack", username=username, password=password)['features'].each do |feature,values|
|
||||
enabled = vars['es_xpack_features'].include? feature
|
||||
status = if enabled then 'enabled' else 'disabled' end
|
||||
it "the xpack feature '#{feature}' to be #{status}" do
|
||||
expect(values['enabled'] = enabled)
|
||||
end
|
||||
end
|
||||
else
|
||||
features.each do |feature, status|
|
||||
feature_available = curl_json("#{es_api_url}/_xpack", username=username, password=password)['features'][feature]['available']
|
||||
if feature_available == "true"
|
||||
status = "available"
|
||||
else
|
||||
status = "unavailable"
|
||||
end
|
||||
it "the xpack feature '#{feature}' to be #{status}" do
|
||||
expect(feature_available = status['available'])
|
||||
end
|
||||
feature_enabled = curl_json("#{es_api_url}/_xpack", username=username, password=password)['features'][feature]['enabled']
|
||||
if feature_enabled == "true"
|
||||
status = "enabled"
|
||||
else
|
||||
status = "disabled"
|
||||
end
|
||||
it "the xpack feature '#{feature}' to be #{status}" do
|
||||
expect(feature_available = status['enabled'])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
describe user(vars['es_user']) do
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@
|
|||
es_heap_size: "1g"
|
||||
es_plugins:
|
||||
- plugin: ingest-attachment
|
||||
es_xpack_features:
|
||||
- security
|
||||
- alerting
|
||||
es_api_basic_auth_username: elastic
|
||||
es_api_basic_auth_password: changeme
|
||||
es_users:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
- elasticsearch
|
||||
vars:
|
||||
es_version: "{{ '7.0.0' if es_major_version == '7.x' else '6.7.1' }}" # This is set to an older version than the current default to force an upgrade
|
||||
es_enable_xpack: false
|
||||
oss_version: true
|
||||
es_heap_size: "1g"
|
||||
|
||||
- name: Standard test for single node setup. Tests idempotence.
|
||||
|
|
@ -17,9 +17,5 @@
|
|||
roles:
|
||||
- elasticsearch
|
||||
vars:
|
||||
es_enable_xpack: true
|
||||
oss_version: false
|
||||
es_heap_size: "1g"
|
||||
es_xpack_features:
|
||||
- monitoring
|
||||
- graph
|
||||
- ml
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
- elasticsearch
|
||||
vars:
|
||||
es_version: "{{ '7.0.0' if es_major_version == '7.x' else '6.7.1' }}" # This is set to an older version than the current default to force an upgrade
|
||||
es_enable_xpack: false
|
||||
oss_version: true
|
||||
es_heap_size: "1g"
|
||||
|
||||
- name: Standard test for single node setup. Tests idempotence.
|
||||
|
|
@ -17,5 +17,5 @@
|
|||
roles:
|
||||
- elasticsearch
|
||||
vars:
|
||||
es_enable_xpack: false
|
||||
oss_version: true
|
||||
es_heap_size: "1g"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
roles:
|
||||
- elasticsearch
|
||||
vars:
|
||||
es_enable_xpack: false
|
||||
oss_version: true
|
||||
es_heap_size: "1g"
|
||||
es_plugins:
|
||||
- plugin: ingest-attachment
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@
|
|||
es_xpack_trial: true
|
||||
es_plugins:
|
||||
- plugin: ingest-attachment
|
||||
es_xpack_features:
|
||||
- security
|
||||
- alerting
|
||||
es_api_basic_auth_username: elastic
|
||||
es_api_basic_auth_password: changeme
|
||||
es_api_sleep: 5
|
||||
|
|
@ -140,9 +137,6 @@
|
|||
es_xpack_trial: false
|
||||
es_plugins:
|
||||
- plugin: ingest-attachment
|
||||
es_xpack_features:
|
||||
- security
|
||||
- alerting
|
||||
es_api_basic_auth_username: elastic
|
||||
es_api_basic_auth_password: elasticChanged
|
||||
es_api_sleep: 5
|
||||
|
|
|
|||
|
|
@ -23,9 +23,6 @@
|
|||
es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}"
|
||||
es_plugins:
|
||||
- plugin: ingest-attachment
|
||||
es_xpack_features:
|
||||
- security
|
||||
- alerting
|
||||
es_api_basic_auth_username: elastic
|
||||
es_api_basic_auth_password: changeme
|
||||
es_api_sleep: 5
|
||||
|
|
@ -138,9 +135,6 @@
|
|||
es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}"
|
||||
es_plugins:
|
||||
- plugin: ingest-attachment
|
||||
es_xpack_features:
|
||||
- security
|
||||
- alerting
|
||||
es_api_basic_auth_username: elastic
|
||||
es_api_basic_auth_password: elasticChanged
|
||||
es_api_sleep: 5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue