From 103499589909f08ec0f7e654473dcd3941308d6a Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Fri, 27 Nov 2015 22:52:36 +0000 Subject: [PATCH] Fix for server spec debian 8 --- README.md | 9 ++++++++- tasks/elasticsearch-config.yml | 3 +-- test/integration/config/serverspec/default_spec.rb | 5 ----- test/integration/multi/serverspec/default_spec.rb | 11 ----------- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index fdb20f3..6f21171 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,13 @@ # ansible-elasticsearch -Ansible playbook / roles / tasks for Elasticsearch. Currently it will work on Debian and RedHat based linux systems. +Ansible playbook / roles / tasks for Elasticsearch. Currently it will work on Debian and RedHat based linux systems. Tested platforms are: + +* Ubuntu 1404 +* Debian 7 +* Debian 8 +* Centos 7 +* Centos 8 + ## Usage diff --git a/tasks/elasticsearch-config.yml b/tasks/elasticsearch-config.yml index afbec76..0a827f2 100644 --- a/tasks/elasticsearch-config.yml +++ b/tasks/elasticsearch-config.yml @@ -5,8 +5,7 @@ #This relies on elasticsearch installing a serviced script to determine whether one should be copied. - stat: path={{sysd_script}} register: systemd_service - -- set_fact: use_system_d={{systemd_service.stat.exists and (ansible_os_family == 'RedHat' or ansible_distribution_version | version_compare('8', '<'))}} +- set_fact: use_system_d={{systemd_service.stat.exists and (not ansible_distribution == 'Debian' or ansible_distribution_version | version_compare('8', '<'))}} - set_fact: instance_sysd_script={{sysd_script | dirname }}/{{es_instance_name}}_{{sysd_script | basename}} when: use_system_d diff --git a/test/integration/config/serverspec/default_spec.rb b/test/integration/config/serverspec/default_spec.rb index 0b07653..eb646e4 100644 --- a/test/integration/config/serverspec/default_spec.rb +++ b/test/integration/config/serverspec/default_spec.rb @@ -73,10 +73,5 @@ context "basic tests" do its(:exit_status) { should eq 0 } end - describe file('/usr/lib/systemd/system/node1_elasticsearch.service') do - it { should be_file } - it { should contain 'LimitMEMLOCK=infinity' } - end - end diff --git a/test/integration/multi/serverspec/default_spec.rb b/test/integration/multi/serverspec/default_spec.rb index 08a784b..91e01d1 100644 --- a/test/integration/multi/serverspec/default_spec.rb +++ b/test/integration/multi/serverspec/default_spec.rb @@ -156,16 +156,5 @@ context "basic tests" do end - #Test server spec file has been created and modified - describe file('/usr/lib/systemd/system/master_elasticsearch.service') do - it { should be_file } - it { should contain 'LimitMEMLOCK=infinity' } - end - - describe file('/usr/lib/systemd/system/node1_elasticsearch.service') do - it { should be_file } - it { should_not contain 'LimitMEMLOCK=infinity' } - end - end