Merge "Fix beaker on xenial"
This commit is contained in:
@@ -24,7 +24,7 @@ class elasticsearch (
|
|||||||
# Ensure: java runtime and curl
|
# Ensure: java runtime and curl
|
||||||
# Curl is handy for talking to the ES API on localhost. Allows for
|
# Curl is handy for talking to the ES API on localhost. Allows for
|
||||||
# querying cluster state and deleting indexes and so on.
|
# querying cluster state and deleting indexes and so on.
|
||||||
ensure_packages(['openjdk-7-jre-headless', 'curl', $::elasticsearch::params::gem_package])
|
ensure_packages([$::elasticsearch::params::jre_package, 'curl', $::elasticsearch::params::gem_package])
|
||||||
|
|
||||||
include '::archive'
|
include '::archive'
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ class elasticsearch (
|
|||||||
source => "/tmp/elasticsearch-${version}.deb",
|
source => "/tmp/elasticsearch-${version}.deb",
|
||||||
provider => 'dpkg',
|
provider => 'dpkg',
|
||||||
require => [
|
require => [
|
||||||
Package['openjdk-7-jre-headless'],
|
Package[$::elasticsearch::params::jre_package],
|
||||||
File['/etc/elasticsearch/elasticsearch.yml'],
|
File['/etc/elasticsearch/elasticsearch.yml'],
|
||||||
File['/etc/elasticsearch/default-mapping.json'],
|
File['/etc/elasticsearch/default-mapping.json'],
|
||||||
File['/etc/elasticsearch/logging.yml'],
|
File['/etc/elasticsearch/logging.yml'],
|
||||||
|
@@ -5,16 +5,28 @@ class elasticsearch::params (
|
|||||||
|
|
||||||
case $::osfamily {
|
case $::osfamily {
|
||||||
'Debian': {
|
'Debian': {
|
||||||
if $::lsbdistcodename == 'precise' {
|
case $::lsbdistcodename {
|
||||||
# package names
|
'precise': {
|
||||||
$gem_package = 'rubygems'
|
$gem_package = 'rubygems'
|
||||||
} else {
|
$jre_package = 'openjdk-7-jre-headless'
|
||||||
# package names
|
}
|
||||||
$gem_package = 'ruby'
|
'trusty': {
|
||||||
|
$gem_package = 'ruby'
|
||||||
|
$jre_package = 'openjdk-7-jre-headless'
|
||||||
|
}
|
||||||
|
'xenial': {
|
||||||
|
$gem_package = 'ruby'
|
||||||
|
$jre_package = 'openjdk-8-jre-headless'
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
$gem_package = 'ruby'
|
||||||
|
$jre_package = 'openjdk-7-jre-headless'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
$gem_package = 'ruby'
|
$gem_package = 'ruby'
|
||||||
|
$jre_package = 'openjdk-7-jre-headless'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -20,55 +20,4 @@ describe 'puppet-elasticsearch module', :if => ['debian', 'ubuntu'].include?(os[
|
|||||||
apply_manifest(default_puppet_module, catch_changes: true)
|
apply_manifest(default_puppet_module, catch_changes: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'required packages' do
|
|
||||||
describe package('curl') do
|
|
||||||
it { should be_installed }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe package('openjdk-7-jre-headless') do
|
|
||||||
it { should be_installed }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe package('elasticsearch') do
|
|
||||||
it { should be_installed }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'required files' do
|
|
||||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
|
||||||
it { should be_file }
|
|
||||||
it { should be_owned_by 'root' }
|
|
||||||
it { should be_grouped_into 'root' }
|
|
||||||
its(:content) { should include 'cluster.name: acceptance-test' }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe file('/etc/elasticsearch/templates') do
|
|
||||||
it { should be_directory }
|
|
||||||
it { should be_owned_by 'root' }
|
|
||||||
it { should be_grouped_into 'root' }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe file('/etc/elasticsearch/default-mapping.json') do
|
|
||||||
it { should be_file }
|
|
||||||
it { should be_owned_by 'root' }
|
|
||||||
it { should be_grouped_into 'root' }
|
|
||||||
its(:content) { should include '"_source": { "compress": true },' }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe file('/etc/default/elasticsearch') do
|
|
||||||
it { should be_file }
|
|
||||||
it { should be_owned_by 'root' }
|
|
||||||
it { should be_grouped_into 'root' }
|
|
||||||
its(:content) { should include 'ES_HEAP_SIZE=16g' }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe file('/tmp/acceptance') do
|
|
||||||
it { should be_directory }
|
|
||||||
it { should be_owned_by 'elasticsearch' }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe cron do
|
|
||||||
it { should have_entry('7 6 * * * find /var/log/elasticsearch -type f -mtime +14 -delete').with_user('root') }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
10
spec/acceptance/nodesets/nodepool-xenial.yml
Normal file
10
spec/acceptance/nodesets/nodepool-xenial.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
ubuntu-16.04-amd64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: ubuntu-16.04-amd64
|
||||||
|
hypervisor: none
|
||||||
|
ip: 127.0.0.1
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
set_env: false
|
@@ -2,7 +2,15 @@ require 'beaker-rspec'
|
|||||||
|
|
||||||
hosts.each do |host|
|
hosts.each do |host|
|
||||||
|
|
||||||
install_puppet
|
# puppet 3 isn't available from apt.puppetlabs.com so install it from the Xenial repos
|
||||||
|
on host, "which apt-get && apt-get install puppet -y", { :acceptable_exit_codes => [0,1] }
|
||||||
|
# otherwise use the beaker helpers to install the yum.puppetlabs.com repo and puppet
|
||||||
|
r = on host, "which yum", { :acceptable_exit_codes => [0,1] }
|
||||||
|
if r.exit_code == 0
|
||||||
|
install_puppet
|
||||||
|
end
|
||||||
|
add_platform_foss_defaults(host, 'unix')
|
||||||
|
|
||||||
|
|
||||||
on host, "mkdir -p #{host['distmoduledir']}"
|
on host, "mkdir -p #{host['distmoduledir']}"
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user