ansible-role-elasticsearch/test/integration/helpers/serverspec/xpack_spec.rb

18 lines
846 B
Ruby
Raw Normal View History

require 'spec_helper'
shared_examples 'xpack::init' do |vars|
describe file("/etc/elasticsearch/#{vars['es_instance_name']}/elasticsearch.yml") do
it { should contain "node.name: localhost-#{vars['es_instance_name']}" }
it { should contain 'cluster.name: elasticsearch' }
2018-01-31 08:17:44 +01:00
if vars['es_major_version'] == '6.x'
it { should_not contain "path.conf: /etc/elasticsearch/#{vars['es_instance_name']}" }
2018-01-31 08:17:44 +01:00
else
it { should contain "path.conf: /etc/elasticsearch/#{vars['es_instance_name']}" }
2018-01-31 08:17:44 +01:00
end
it { should contain "path.data: /var/lib/elasticsearch/localhost-#{vars['es_instance_name']}" }
it { should contain "path.logs: /var/log/elasticsearch/localhost-#{vars['es_instance_name']}" }
it { should contain 'xpack.security.enabled: false' }
it { should contain 'xpack.watcher.enabled: false' }
end
end