Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #431 from elastic/6.2-support
Browse files Browse the repository at this point in the history
Bump default version to 6.2.2 and 5.6.8
  • Loading branch information
Crazybus authored Feb 22, 2018
2 parents 644a209 + 38982ba commit 8c35b8c
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ provisioner:
extra_vars:
es_major_version: "<%= ENV['VERSION'] %>"
<% if ENV['VERSION'] == '5.x' %>
es_version: '5.6.7'
es_version: '5.6.8'
<% end %>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
es_major_version: "6.x"
es_version: "6.1.3"
es_version: "6.2.2"
es_version_lock: false
es_use_repository: true
es_templates_fileglob: "files/templates/*.json"
Expand Down
14 changes: 10 additions & 4 deletions tasks/elasticsearch-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,20 @@
become: yes
file: dest=/etc/init.d/elasticsearch state=absent

- name: Delete Default Environment File
- name: Create empty default environment file
become: yes
file: dest=/etc/default/elasticsearch state=absent
changed_when: False
copy:
dest: /etc/default/elasticsearch
content: ''
when: ansible_os_family == 'Debian'

- name: Delete Default Environment File
- name: Create empty default environment file
become: yes
file: dest=/etc/sysconfig/elasticsearch state=absent
changed_when: False
copy:
dest: /etc/sysconfig/elasticsearch
content: ''
when: ansible_os_family == 'RedHat'

- name: Delete Default Sysconfig File
Expand Down
12 changes: 8 additions & 4 deletions test/integration/helpers/serverspec/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,16 @@
it { should_not exist }
end

describe file('/etc/default/elasticsearch') do
it { should_not exist }
if ['debian', 'ubuntu'].include?(os[:family])
describe file('/etc/default/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/etc/sysconfig/elasticsearch') do
it { should_not exist }
if ['centos', 'redhat'].include?(os[:family])
describe file('/etc/sysconfig/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/usr/lib/systemd/system/elasticsearch.service') do
Expand Down
12 changes: 8 additions & 4 deletions test/integration/helpers/serverspec/multi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,16 @@
it { should_not exist }
end

describe file('/etc/default/elasticsearch') do
it { should_not exist }
if ['debian', 'ubuntu'].include?(os[:family])
describe file('/etc/default/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/etc/sysconfig/elasticsearch') do
it { should_not exist }
if ['centos', 'redhat'].include?(os[:family])
describe file('/etc/sysconfig/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/usr/lib/systemd/system/elasticsearch.service') do
Expand Down
12 changes: 8 additions & 4 deletions test/integration/helpers/serverspec/package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@
it { should_not exist }
end

describe file('/etc/default/elasticsearch') do
it { should_not exist }
if ['debian', 'ubuntu'].include?(os[:family])
describe file('/etc/default/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/etc/sysconfig/elasticsearch') do
it { should_not exist }
if ['centos', 'redhat'].include?(os[:family])
describe file('/etc/sysconfig/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/usr/lib/systemd/system/elasticsearch.service') do
Expand Down
12 changes: 8 additions & 4 deletions test/integration/helpers/serverspec/standard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@
it { should_not exist }
end

describe file('/etc/default/elasticsearch') do
it { should_not exist }
if ['debian', 'ubuntu'].include?(os[:family])
describe file('/etc/default/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/etc/sysconfig/elasticsearch') do
it { should_not exist }
if ['centos', 'redhat'].include?(os[:family])
describe file('/etc/sysconfig/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/usr/lib/systemd/system/elasticsearch.service') do
Expand Down
12 changes: 8 additions & 4 deletions test/integration/helpers/serverspec/xpack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@
it { should_not exist }
end

describe file('/etc/default/elasticsearch') do
it { should_not exist }
if ['debian', 'ubuntu'].include?(os[:family])
describe file('/etc/default/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/etc/sysconfig/elasticsearch') do
it { should_not exist }
if ['centos', 'redhat'].include?(os[:family])
describe file('/etc/sysconfig/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/usr/lib/systemd/system/elasticsearch.service') do
Expand Down
33 changes: 27 additions & 6 deletions test/integration/helpers/serverspec/xpack_standard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@
it { should_not exist }
end

describe file('/etc/default/elasticsearch') do
it { should_not exist }
if ['debian', 'ubuntu'].include?(os[:family])
describe file('/etc/default/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/etc/sysconfig/elasticsearch') do
it { should_not exist }
if ['centos', 'redhat'].include?(os[:family])
describe file('/etc/sysconfig/elasticsearch') do
its(:content) { should match '' }
end
end

describe file('/usr/lib/systemd/system/elasticsearch.service') do
Expand Down Expand Up @@ -116,8 +120,25 @@
it { should be_owned_by 'elasticsearch' }
end

describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"x-pack","version":"'+vars['es_version']+'"\'') do
its(:exit_status) { should eq 0 }
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
Expand Down

0 comments on commit 8c35b8c

Please sign in to comment.