diff --git a/.kitchen.yml b/.kitchen.yml index 0348eaf..f0d6ad1 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -15,7 +15,7 @@ provisioner: platforms: - name: ubuntu-14.04 driver_config: - image: electrical/ubuntu:14.04 + image: dliappis/ubuntu:14.04 privileged: true provision_command: - apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:ansible/ansible @@ -23,7 +23,7 @@ platforms: use_sudo: false - name: debian-7 driver_config: - image: electrical/debian:7.3 + image: debian:7 privileged: true provision_command: - apt-get update && apt-get -y install python python-dev python-pip build-essential libyaml-dev python-yaml @@ -32,10 +32,10 @@ platforms: use_sudo: false - name: debian-8 driver_config: - image: electrical/debian:8 + image: debian:8 privileged: true provision_command: - - apt-get update && apt-get -y install python python-dev python-pip build-essential libyaml-dev python-yaml + - apt-get update && apt-get -y install python python-dev python-pip build-essential libyaml-dev python-yaml curl wget - pip install ansible - apt-get install -y -q net-tools - sed -ri 's/^#?PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config @@ -45,16 +45,18 @@ platforms: run_command: "/sbin/init" - name: centos-6 driver_config: - image: electrical/centos:6.4-1 + image: dliappis/centos:6 privileged: true provision_command: + - yum remove -y ansible - yum -y install gmp-devel python-devel python-pip - pip install ansible use_sudo: false - name: centos-7 driver_config: - image: electrical/centos:7 + image: dliappis/centos:7 provision_command: + - yum remove -y ansible - yum -y install gmp-devel python-devel python-pip - yum -y groupinstall "Development Tools" - pip install ansible diff --git a/Gemfile b/Gemfile index 8607482..e0591b1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'test-kitchen' -gem "kitchen-docker", '< 2.2.0' +gem 'test-kitchen', '1.4.2' +gem "kitchen-docker", '2.1.0' gem 'kitchen-ansible', '0.40.1' gem 'net-ssh', '~> 2.0' diff --git a/README.md b/README.md index d94ecd8..98a24d0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Ansible role for Elasticsearch. Currently this works on Debian and RedHat based * Centos 6 * Centos 7 -The latest Elasticsearch versions of 1.7.x and 2.x are actively tested. +The latest Elasticsearch versions of 1.7.x and 2.x are actively tested. **Only Ansible versions 2.x are supported.** ## Usage diff --git a/defaults/main.yml b/defaults/main.yml index 7bf9af0..5f7bd60 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- es_major_version: "2.x" -es_version: "2.1.0" +es_version: "2.2.0" es_version_lock: false es_use_repository: true es_start_service: true diff --git a/tasks/elasticsearch-plugins.yml b/tasks/elasticsearch-plugins.yml index caa7316..8347c23 100644 --- a/tasks/elasticsearch-plugins.yml +++ b/tasks/elasticsearch-plugins.yml @@ -5,7 +5,6 @@ when: elasticsearch_install.changed or es_plugins is not defined or es_plugins is none - set_fact: list_command="list" - - set_fact: list_command="--list" when: es_version | version_compare('2.0', '<') @@ -31,16 +30,9 @@ - name: Install elasticsearch plugins #debug: var=item command: > - {{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 + {{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 register: plugin_installed - failed_when: "'Failed to install' in plugin_installed.stderr" + failed_when: "'ERROR' in plugin_installed.stdout" changed_when: plugin_installed.rc == 0 with_items: es_plugins when: es_plugins is defined and not es_plugins is none diff --git a/test/integration/config-2x/serverspec/default_spec.rb b/test/integration/config-2x/serverspec/default_spec.rb index 0650ee1..377fb3b 100644 --- a/test/integration/config-2x/serverspec/default_spec.rb +++ b/test/integration/config-2x/serverspec/default_spec.rb @@ -1,6 +1,6 @@ require 'config_spec' describe 'Config Tests v 2.x' do - include_examples 'config::init', "2.1.0" + include_examples 'config::init', "2.2.0" end diff --git a/test/integration/helpers/serverspec/config_spec.rb b/test/integration/helpers/serverspec/config_spec.rb index 7eeb44c..396b9c1 100644 --- a/test/integration/helpers/serverspec/config_spec.rb +++ b/test/integration/helpers/serverspec/config_spec.rb @@ -103,6 +103,10 @@ shared_examples 'config::init' do |es_version| it { should_not exist } end + describe file('/etc/elasticsearch/logging.yml') do + it { should_not exist } + end + #Init vs Systemd tests #Ubuntu 15 and up #Debian 8 and up diff --git a/test/integration/helpers/serverspec/multi_spec.rb b/test/integration/helpers/serverspec/multi_spec.rb index 1042ef6..a52bf80 100644 --- a/test/integration/helpers/serverspec/multi_spec.rb +++ b/test/integration/helpers/serverspec/multi_spec.rb @@ -225,6 +225,9 @@ shared_examples 'multi::init' do |es_version,plugins| it { should_not exist } end + describe file('/etc/elasticsearch/logging.yml') do + it { should_not exist } + end #Test server spec file has been created and modified - currently not possible as not copied for debian 8 diff --git a/test/integration/helpers/serverspec/package_spec.rb b/test/integration/helpers/serverspec/package_spec.rb index 1e4218e..2d2dbbb 100644 --- a/test/integration/helpers/serverspec/package_spec.rb +++ b/test/integration/helpers/serverspec/package_spec.rb @@ -103,5 +103,9 @@ shared_examples 'package::init' do |es_version,plugins| it { should_not exist } end + describe file('/etc/elasticsearch/logging.yml') do + it { should_not exist } + end + end diff --git a/test/integration/helpers/serverspec/standard_spec.rb b/test/integration/helpers/serverspec/standard_spec.rb index 05b8e0e..3133493 100644 --- a/test/integration/helpers/serverspec/standard_spec.rb +++ b/test/integration/helpers/serverspec/standard_spec.rb @@ -67,5 +67,9 @@ shared_examples 'standard::init' do |es_version| it { should_not exist } end + describe file('/etc/elasticsearch/logging.yml') do + it { should_not exist } + end + end diff --git a/test/integration/multi-2x/serverspec/default_spec.rb b/test/integration/multi-2x/serverspec/default_spec.rb index 4e1bc69..17bb9c1 100644 --- a/test/integration/multi-2x/serverspec/default_spec.rb +++ b/test/integration/multi-2x/serverspec/default_spec.rb @@ -2,7 +2,7 @@ require 'multi_spec' describe 'Multi Tests v 2.x' do - include_examples 'multi::init', "2.1.0", ["kopf","license","marvel-agent"] + include_examples 'multi::init', "2.2.0", ["kopf","license","marvel-agent"] end diff --git a/test/integration/package-2x/serverspec/default_spec.rb b/test/integration/package-2x/serverspec/default_spec.rb index f87daf7..bc884cc 100644 --- a/test/integration/package-2x/serverspec/default_spec.rb +++ b/test/integration/package-2x/serverspec/default_spec.rb @@ -2,5 +2,5 @@ require 'package_spec' describe 'Package Tests v 2.x' do - include_examples 'package::init', "2.1.0", ["kopf","license","marvel-agent"] + include_examples 'package::init', "2.2.0", ["kopf","license","marvel-agent"] end \ No newline at end of file diff --git a/test/integration/standard-2x/serverspec/default_spec.rb b/test/integration/standard-2x/serverspec/default_spec.rb index 3d61cb0..8f45e24 100644 --- a/test/integration/standard-2x/serverspec/default_spec.rb +++ b/test/integration/standard-2x/serverspec/default_spec.rb @@ -2,7 +2,7 @@ require 'standard_spec' describe 'Standard Tests v 2.x' do - include_examples 'standard::init', "2.1.0" + include_examples 'standard::init', "2.2.0" end