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:
Julien Mailleret 2020-06-12 18:15:03 +02:00 committed by GitHub
parent c12542836e
commit cab03ece10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 31 additions and 74 deletions

View file

@ -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