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

Commit 8c35b8c

Browse files
authored
Merge pull request #431 from elastic/6.2-support
Bump default version to 6.2.2 and 5.6.8
2 parents 644a209 + 38982ba commit 8c35b8c

File tree

9 files changed

+79
-32
lines changed

9 files changed

+79
-32
lines changed

.kitchen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ provisioner:
2121
extra_vars:
2222
es_major_version: "<%= ENV['VERSION'] %>"
2323
<% if ENV['VERSION'] == '5.x' %>
24-
es_version: '5.6.7'
24+
es_version: '5.6.8'
2525
<% end %>
2626
<% end %>
2727

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
es_major_version: "6.x"
3-
es_version: "6.1.3"
3+
es_version: "6.2.2"
44
es_version_lock: false
55
es_use_repository: true
66
es_templates_fileglob: "files/templates/*.json"

tasks/elasticsearch-config.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,20 @@
7070
become: yes
7171
file: dest=/etc/init.d/elasticsearch state=absent
7272

73-
- name: Delete Default Environment File
73+
- name: Create empty default environment file
7474
become: yes
75-
file: dest=/etc/default/elasticsearch state=absent
75+
changed_when: False
76+
copy:
77+
dest: /etc/default/elasticsearch
78+
content: ''
7679
when: ansible_os_family == 'Debian'
7780

78-
- name: Delete Default Environment File
81+
- name: Create empty default environment file
7982
become: yes
80-
file: dest=/etc/sysconfig/elasticsearch state=absent
83+
changed_when: False
84+
copy:
85+
dest: /etc/sysconfig/elasticsearch
86+
content: ''
8187
when: ansible_os_family == 'RedHat'
8288

8389
- name: Delete Default Sysconfig File

test/integration/helpers/serverspec/config_spec.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,16 @@
113113
it { should_not exist }
114114
end
115115

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

120-
describe file('/etc/sysconfig/elasticsearch') do
121-
it { should_not exist }
122+
if ['centos', 'redhat'].include?(os[:family])
123+
describe file('/etc/sysconfig/elasticsearch') do
124+
its(:content) { should match '' }
125+
end
122126
end
123127

124128
describe file('/usr/lib/systemd/system/elasticsearch.service') do

test/integration/helpers/serverspec/multi_spec.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,16 @@
200200
it { should_not exist }
201201
end
202202

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

207-
describe file('/etc/sysconfig/elasticsearch') do
208-
it { should_not exist }
209+
if ['centos', 'redhat'].include?(os[:family])
210+
describe file('/etc/sysconfig/elasticsearch') do
211+
its(:content) { should match '' }
212+
end
209213
end
210214

211215
describe file('/usr/lib/systemd/system/elasticsearch.service') do

test/integration/helpers/serverspec/package_spec.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,16 @@
8888
it { should_not exist }
8989
end
9090

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

95-
describe file('/etc/sysconfig/elasticsearch') do
96-
it { should_not exist }
97+
if ['centos', 'redhat'].include?(os[:family])
98+
describe file('/etc/sysconfig/elasticsearch') do
99+
its(:content) { should match '' }
100+
end
97101
end
98102

99103
describe file('/usr/lib/systemd/system/elasticsearch.service') do

test/integration/helpers/serverspec/standard_spec.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,16 @@
6060
it { should_not exist }
6161
end
6262

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

67-
describe file('/etc/sysconfig/elasticsearch') do
68-
it { should_not exist }
69+
if ['centos', 'redhat'].include?(os[:family])
70+
describe file('/etc/sysconfig/elasticsearch') do
71+
its(:content) { should match '' }
72+
end
6973
end
7074

7175
describe file('/usr/lib/systemd/system/elasticsearch.service') do

test/integration/helpers/serverspec/xpack_spec.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,16 @@
5656
it { should_not exist }
5757
end
5858

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

63-
describe file('/etc/sysconfig/elasticsearch') do
64-
it { should_not exist }
65+
if ['centos', 'redhat'].include?(os[:family])
66+
describe file('/etc/sysconfig/elasticsearch') do
67+
its(:content) { should match '' }
68+
end
6569
end
6670

6771
describe file('/usr/lib/systemd/system/elasticsearch.service') do

test/integration/helpers/serverspec/xpack_standard_spec.rb

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,16 @@
5757
it { should_not exist }
5858
end
5959

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

64-
describe file('/etc/sysconfig/elasticsearch') do
65-
it { should_not exist }
66+
if ['centos', 'redhat'].include?(os[:family])
67+
describe file('/etc/sysconfig/elasticsearch') do
68+
its(:content) { should match '' }
69+
end
6670
end
6771

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

119-
describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"x-pack","version":"'+vars['es_version']+'"\'') do
120-
its(:exit_status) { should eq 0 }
123+
describe 'x-pack-core plugin' do
124+
it 'should be installed with the correct version' do
125+
plugins = curl_json('http://localhost:9200/_nodes/plugins')
126+
node, data = plugins['nodes'].first
127+
version = 'plugin not found'
128+
129+
if Gem::Version.new(vars['es_version']) >= Gem::Version.new('6.2')
130+
name = 'x-pack-core'
131+
else
132+
name = 'x-pack'
133+
end
134+
135+
data['plugins'].each do |plugin|
136+
if plugin['name'] == name
137+
version = plugin['version']
138+
end
139+
end
140+
expect(version).to eql(vars['es_version'])
141+
end
121142
end
122143

123144
#Test users file, users_roles and roles.yml

0 commit comments

Comments
 (0)