Merge "Fix beaker on xenial"
This commit is contained in:
commit
b5d7ae0ea9
@ -24,7 +24,7 @@ class elasticsearch (
|
||||
# Ensure: java runtime and curl
|
||||
# Curl is handy for talking to the ES API on localhost. Allows for
|
||||
# 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'
|
||||
|
||||
@ -57,7 +57,7 @@ class elasticsearch (
|
||||
source => "/tmp/elasticsearch-${version}.deb",
|
||||
provider => 'dpkg',
|
||||
require => [
|
||||
Package['openjdk-7-jre-headless'],
|
||||
Package[$::elasticsearch::params::jre_package],
|
||||
File['/etc/elasticsearch/elasticsearch.yml'],
|
||||
File['/etc/elasticsearch/default-mapping.json'],
|
||||
File['/etc/elasticsearch/logging.yml'],
|
||||
|
@ -5,16 +5,28 @@ class elasticsearch::params (
|
||||
|
||||
case $::osfamily {
|
||||
'Debian': {
|
||||
if $::lsbdistcodename == 'precise' {
|
||||
# package names
|
||||
$gem_package = 'rubygems'
|
||||
} else {
|
||||
# package names
|
||||
$gem_package = 'ruby'
|
||||
case $::lsbdistcodename {
|
||||
'precise': {
|
||||
$gem_package = 'rubygems'
|
||||
$jre_package = 'openjdk-7-jre-headless'
|
||||
}
|
||||
'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: {
|
||||
$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)
|
||||
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
|
||||
|
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|
|
||||
|
||||
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']}"
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user