Skip to content

Commit 83303e4

Browse files
author
gingerwizard
committed
Merge pull request elastic#87 from gingerwizard/master
Correct Error detection for plugin install and check logging.yml is removed
2 parents 3c5adf9 + 482231a commit 83303e4

File tree

13 files changed

+33
-24
lines changed

13 files changed

+33
-24
lines changed

.kitchen.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ provisioner:
1515
platforms:
1616
- name: ubuntu-14.04
1717
driver_config:
18-
image: electrical/ubuntu:14.04
18+
image: dliappis/ubuntu:14.04
1919
privileged: true
2020
provision_command:
2121
- apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:ansible/ansible
2222
- apt-get update && apt-get -y -q install ansible python-apt python-pycurl
2323
use_sudo: false
2424
- name: debian-7
2525
driver_config:
26-
image: electrical/debian:7.3
26+
image: debian:7
2727
privileged: true
2828
provision_command:
2929
- apt-get update && apt-get -y install python python-dev python-pip build-essential libyaml-dev python-yaml
@@ -32,10 +32,10 @@ platforms:
3232
use_sudo: false
3333
- name: debian-8
3434
driver_config:
35-
image: electrical/debian:8
35+
image: debian:8
3636
privileged: true
3737
provision_command:
38-
- apt-get update && apt-get -y install python python-dev python-pip build-essential libyaml-dev python-yaml
38+
- apt-get update && apt-get -y install python python-dev python-pip build-essential libyaml-dev python-yaml curl wget
3939
- pip install ansible
4040
- apt-get install -y -q net-tools
4141
- sed -ri 's/^#?PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
@@ -45,16 +45,18 @@ platforms:
4545
run_command: "/sbin/init"
4646
- name: centos-6
4747
driver_config:
48-
image: electrical/centos:6.4-1
48+
image: dliappis/centos:6
4949
privileged: true
5050
provision_command:
51+
- yum remove -y ansible
5152
- yum -y install gmp-devel python-devel python-pip
5253
- pip install ansible
5354
use_sudo: false
5455
- name: centos-7
5556
driver_config:
56-
image: electrical/centos:7
57+
image: dliappis/centos:7
5758
provision_command:
59+
- yum remove -y ansible
5860
- yum -y install gmp-devel python-devel python-pip
5961
- yum -y groupinstall "Development Tools"
6062
- pip install ansible

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'test-kitchen'
4-
gem "kitchen-docker", '< 2.2.0'
3+
gem 'test-kitchen', '1.4.2'
4+
gem "kitchen-docker", '2.1.0'
55
gem 'kitchen-ansible', '0.40.1'
66
gem 'net-ssh', '~> 2.0'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Ansible role for Elasticsearch. Currently this works on Debian and RedHat based
88
* Centos 6
99
* Centos 7
1010

11-
The latest Elasticsearch versions of 1.7.x and 2.x are actively tested.
11+
The latest Elasticsearch versions of 1.7.x and 2.x are actively tested. **Only Ansible versions 2.x are supported.**
1212

1313
## Usage
1414

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: "2.x"
3-
es_version: "2.1.0"
3+
es_version: "2.2.0"
44
es_version_lock: false
55
es_use_repository: true
66
es_start_service: true

tasks/elasticsearch-plugins.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
when: elasticsearch_install.changed or es_plugins is not defined or es_plugins is none
66

77
- set_fact: list_command="list"
8-
98
- set_fact: list_command="--list"
109
when: es_version | version_compare('2.0', '<')
1110

@@ -31,16 +30,9 @@
3130
- name: Install elasticsearch plugins
3231
#debug: var=item
3332
command: >
34-
{{es_home}}/bin/plugin install
35-
{{ item.plugin }}{% if item.version is defined and item.version != '' %}/{{ item.version }}{% endif %}
36-
{% if item.proxy_host is defined and item.proxy_host != '' and item.proxy_port is defined and item.proxy_port != ''%}
37-
-DproxyHost={{ item.proxy_host }} -DproxyPort={{ item.proxy_port }}
38-
{% elif es_proxy_host is defined and es_proxy_host != '' %}
39-
-DproxyHost={{ es_proxy_host }} -DproxyPort={{ es_proxy_port }}
40-
{% endif %}
41-
--silent
33+
{{es_home}}/bin/plugin install {{ item.plugin }}{% if item.version is defined and item.version != '' %}/{{ item.version }}{% endif %} {% if item.proxy_host is defined and item.proxy_host != '' and item.proxy_port is defined and item.proxy_port != ''%} -DproxyHost={{ item.proxy_host }} -DproxyPort={{ item.proxy_port }} {% elif es_proxy_host is defined and es_proxy_host != '' %} -DproxyHost={{ es_proxy_host }} -DproxyPort={{ es_proxy_port }} {% endif %} --silent
4234
register: plugin_installed
43-
failed_when: "'Failed to install' in plugin_installed.stderr"
35+
failed_when: "'ERROR' in plugin_installed.stdout"
4436
changed_when: plugin_installed.rc == 0
4537
with_items: es_plugins
4638
when: es_plugins is defined and not es_plugins is none
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'config_spec'
22

33
describe 'Config Tests v 2.x' do
4-
include_examples 'config::init', "2.1.0"
4+
include_examples 'config::init', "2.2.0"
55
end
66

test/integration/helpers/serverspec/config_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@
103103
it { should_not exist }
104104
end
105105

106+
describe file('/etc/elasticsearch/logging.yml') do
107+
it { should_not exist }
108+
end
109+
106110
#Init vs Systemd tests
107111
#Ubuntu 15 and up
108112
#Debian 8 and up

test/integration/helpers/serverspec/multi_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@
225225
it { should_not exist }
226226
end
227227

228+
describe file('/etc/elasticsearch/logging.yml') do
229+
it { should_not exist }
230+
end
228231

229232

230233
#Test server spec file has been created and modified - currently not possible as not copied for debian 8

test/integration/helpers/serverspec/package_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,9 @@
103103
it { should_not exist }
104104
end
105105

106+
describe file('/etc/elasticsearch/logging.yml') do
107+
it { should_not exist }
108+
end
109+
106110
end
107111

test/integration/helpers/serverspec/standard_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,9 @@
6767
it { should_not exist }
6868
end
6969

70+
describe file('/etc/elasticsearch/logging.yml') do
71+
it { should_not exist }
72+
end
73+
7074
end
7175

test/integration/multi-2x/serverspec/default_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
describe 'Multi Tests v 2.x' do
5-
include_examples 'multi::init', "2.1.0", ["kopf","license","marvel-agent"]
5+
include_examples 'multi::init', "2.2.0", ["kopf","license","marvel-agent"]
66
end
77

88

test/integration/package-2x/serverspec/default_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33

44
describe 'Package Tests v 2.x' do
5-
include_examples 'package::init', "2.1.0", ["kopf","license","marvel-agent"]
5+
include_examples 'package::init', "2.2.0", ["kopf","license","marvel-agent"]
66
end

test/integration/standard-2x/serverspec/default_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
describe 'Standard Tests v 2.x' do
5-
include_examples 'standard::init', "2.1.0"
5+
include_examples 'standard::init', "2.2.0"
66
end
77

88

0 commit comments

Comments
 (0)