WIP: 6.3 support

This commit is contained in:
Michael Russell 2018-06-13 08:29:45 +02:00
parent a9f8403ffa
commit 6d82cf3142
No known key found for this signature in database
GPG key ID: A90C1696496085FE
17 changed files with 82 additions and 70 deletions

View file

@ -18,7 +18,7 @@ shared_examples 'config::init' do |vars|
it { should be_running }
end
describe package('elasticsearch') do
describe package(vars['es_package_name']) do
it { should be_installed }
end

View file

@ -16,7 +16,7 @@ shared_examples 'multi::init' do |vars|
it { should be_running }
end
describe package('elasticsearch') do
describe package(vars['es_package_name']) do
it { should be_installed }
end

View file

@ -12,7 +12,7 @@ shared_examples 'package::init' do |vars|
it { should be_running }
end
describe package('elasticsearch') do
describe package(vars['es_package_name']) do
it { should be_installed }
end

View file

@ -10,7 +10,7 @@ shared_examples 'standard::init' do |vars|
it { should be_running }
end
describe package('elasticsearch') do
describe package(vars['es_package_name']) do
it { should be_installed }
end
@ -85,15 +85,22 @@ shared_examples 'standard::init' do |vars|
end
for plugin in vars['es_plugins']
plugin = plugin['plugin']
name = plugin['plugin']
describe file('/usr/share/elasticsearch/plugins/'+plugin) do
describe file('/usr/share/elasticsearch/plugins/'+name) do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
end
#confirm plugins are installed and the correct version
describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"'+plugin+'","version":"'+vars['es_version']+'"\'') do
its(:exit_status) { should eq 0 }
it 'should be installed and the right version' do
plugins = curl_json('http://localhost:9200/_nodes/plugins')
version = nil
node, data = plugins['nodes'].first
data['plugins'].each do |plugin|
if plugin['name'] == name
version = plugin['version']
end
end
expect(version).to eql(vars['es_version'])
end
end

View file

@ -12,7 +12,7 @@ shared_examples 'xpack::init' do |vars|
it { should be_running }
end
describe package('elasticsearch') do
describe package(vars['es_package_name']) do
it { should be_installed }
end

View file

@ -10,7 +10,7 @@ shared_examples 'xpack_standard::init' do |vars|
it { should be_running }
end
describe package('elasticsearch') do
describe package(vars['es_package_name']) do
it { should be_installed }
end
@ -96,60 +96,48 @@ shared_examples 'xpack_standard::init' do |vars|
end
end
describe file('/usr/share/elasticsearch/plugins/x-pack') do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
# X-Pack is no longer installed as a plugin in elasticsearch
if vars['es_major_version'] == '5.x'
describe file('/usr/share/elasticsearch/plugins/x-pack') do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
end
describe 'x-pack-core plugin' do
it 'should be installed with the correct version' do
plugins = curl_json('http://localhost:9200/_nodes/plugins')
node, data = plugins['nodes'].first
version = 'plugin not found'
name = 'x-pack'
data['plugins'].each do |plugin|
if plugin['name'] == name
version = plugin['version']
end
end
expect(version).to eql(vars['es_version'])
end
end
describe file('/etc/elasticsearch/security_node/x-pack') do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
end
#Test users file, users_roles and roles.yml
describe file('/etc/elasticsearch/security_node/x-pack/users_roles') do
it { should be_owned_by 'elasticsearch' }
end
describe file('/etc/elasticsearch/security_node/x-pack/users') do
it { should be_owned_by 'elasticsearch' }
end
end
describe command('curl -s localhost:9200/_nodes/plugins?pretty=true -u es_admin:changeMeAgain | grep x-pack') do
its(:exit_status) { should eq 0 }
end
describe file('/etc/elasticsearch/security_node/x-pack') do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
end
describe file('/usr/share/elasticsearch/plugins/x-pack') do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
end
describe file('/usr/share/elasticsearch/plugins/x-pack') do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
end
describe 'x-pack-core plugin' do
it 'should be installed with the correct version' do
plugins = curl_json('http://localhost:9200/_nodes/plugins')
node, data = plugins['nodes'].first
version = 'plugin not found'
if Gem::Version.new(vars['es_version']) >= Gem::Version.new('6.2')
name = 'x-pack-core'
else
name = 'x-pack'
end
data['plugins'].each do |plugin|
if plugin['name'] == name
version = plugin['version']
end
end
expect(version).to eql(vars['es_version'])
end
end
#Test users file, users_roles and roles.yml
describe file('/etc/elasticsearch/security_node/x-pack/users_roles') do
it { should be_owned_by 'elasticsearch' }
end
describe file('/etc/elasticsearch/security_node/x-pack/users') do
it { should be_owned_by 'elasticsearch' }
end
describe command('curl -s localhost:9200/_xpack') do
its(:stdout_as_json) { should include('features' => include('security' => include('enabled' => false))) }
its(:stdout_as_json) { should include('features' => include('watcher' => include('enabled' => false))) }

View file

@ -6,7 +6,8 @@
roles:
- { role: elasticsearch, es_instance_name: "node1" }
vars:
es_use_repository: "true"
es_enable_xpack: false
es_package_name: "elasticsearch-oss"
es_heap_size: "1g"
es_plugins:
- plugin: ingest-geoip

View file

@ -7,9 +7,9 @@
roles:
- { role: elasticsearch, es_api_port: 9200, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "security_node" }
vars:
es_xpack_custom_url: "https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-{{ es_version }}.zip"
es_heap_size: 2g
es_enable_xpack: true
es_xpack_custom_url: "https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-{{ es_version }}.zip"
es_xpack_features:
- monitoring
- graph

View file

@ -10,7 +10,8 @@
vars:
es_heap_size: "1g"
es_templates: true
es_version: "{{ '6.1.1' if es_major_version == '6.x' else '5.4.0'}}" # This is set to an older version than the current default to force an upgrade
es_version: "{{ '6.2.4' if es_major_version == '6.x' else '5.6.6' }}" # This is set to an older version than the current default to force an upgrade
es_use_snapshot_release: false # TODO remove when 6.3 is released
es_enable_xpack: true
es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}"
es_plugins: