Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Issue 1093 #1097

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 1 addition & 55 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
sudo: required
# group: deprecated-2017Q4
services:
- docker
cache:
Expand All @@ -11,31 +10,18 @@ language: ruby
script: travis_retry bundle exec rake $TASK
jobs:
allow_failures:
- env:
- TASK=beaker:ubuntu-server-1404-x64:snapshot
- env:
- OSS_PACKAGE=true
- TASK=beaker:ubuntu-server-1404-x64:snapshot
- env:
- TASK=beaker:ubuntu-server-1604-x64:snapshot
- env:
- OSS_PACKAGE=true
- TASK=beaker:ubuntu-server-1604-x64:snapshot
- env:
- TASK=beaker:centos-6-x64:snapshot
- env:
- OSS_PACKAGE=true
- TASK=beaker:centos-6-x64:snapshot
- env:
- TASK=beaker:centos-7-x64:snapshot
- env:
- OSS_PACKAGE=true
- TASK=beaker:centos-7-x64:snapshot
- env:
- TASK=beaker:debian-8-x64:snapshot
- env:
- OSS_PACKAGE=true
- TASK=beaker:debian-8-x64:snapshot
- env:
- TASK=beaker:debian-9-x64:snapshot
- env:
Expand All @@ -47,7 +33,7 @@ jobs:
- TASK=intake
- env:
- TASK=intake
- PUPPET_VERSION='~> 5.0'
- PUPPET_VERSION='~> 6.0'
- stage: acceptance
env:
- BEAKER_PUPPET_COLLECTION=puppet6
Expand All @@ -61,12 +47,6 @@ jobs:
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:amazonlinux-2-x64:acceptance[7.8.0]
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:centos-6-x64:acceptance
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:centos-6-x64:acceptance[7.8.0]
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:centos-7-x64:acceptance
Expand All @@ -79,24 +59,12 @@ jobs:
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:centos-8-x64:acceptance[7.8.0]
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:oracle-6-x64:acceptance
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:oracle-6-x64:acceptance[7.8.0]
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:oracle-7-x64:acceptance
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:oracle-7-x64:acceptance[7.8.0]
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:debian-8-x64:acceptance
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:debian-8-x64:acceptance[7.8.0]
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:debian-9-x64:acceptance
Expand All @@ -109,12 +77,6 @@ jobs:
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:debian-10-x64:acceptance[7.8.0]
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:ubuntu-server-1404-x64:acceptance
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:ubuntu-server-1404-x64:acceptance[7.8.0]
- env:
- BEAKER_PUPPET_COLLECTION=puppet6
- TASK=beaker:ubuntu-server-1604-x64:acceptance
Expand All @@ -133,32 +95,16 @@ jobs:
# - env:
# - BEAKER_PUPPET_COLLECTION=puppet6
# - TASK=beaker:ubuntu-server-2004-x64:acceptance[7.8.0]
- stage: snapshots
env:
- TASK=beaker:ubuntu-server-1404-x64:snapshot
env:
- OSS_PACKAGE=true
- TASK=beaker:ubuntu-server-1404-x64:snapshot
- env:
- TASK=beaker:ubuntu-server-1604-x64:snapshot
- env:
- OSS_PACKAGE=true
- TASK=beaker:ubuntu-server-1604-x64:snapshot
- env:
- TASK=beaker:centos-6-x64:snapshot
- env:
- OSS_PACKAGE=true
- TASK=beaker:centos-6-x64:snapshot
- env:
- TASK=beaker:centos-7-x64:snapshot
- env:
- OSS_PACKAGE=true
- TASK=beaker:centos-7-x64:snapshot
- env:
- TASK=beaker:debian-8-x64:snapshot
- env:
- OSS_PACKAGE=true
- TASK=beaker:debian-8-x64:snapshot
- env:
- TASK=beaker:debian-9-x64:snapshot
- env:
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ Matthias Baur (baurmatt)
Gavin Williams (fatmcgav)
Giedrius Statkevičius (GiedriusS)
Jakub Pieńkowski (Jakski)
Grant Davies (grant-veepshosting)
19 changes: 18 additions & 1 deletion data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,22 @@ elasticsearch::init_defaults: {}
elasticsearch::init_defaults_file: ~
elasticsearch::init_template: "%{module_name}/etc/init.d/elasticsearch.systemd.erb"
elasticsearch::instances: {}
elasticsearch::jvm_options: []
elasticsearch::jvm_options:
- '-Dfile.encoding=UTF-8'
- '-Dio.netty.noUnsafe=true'
- '-Dio.netty.noKeySetOptimization=true'
- '-Dio.netty.recycler.maxCapacityPerThread=0'
- '-Djava.awt.headless=true'
- '-Djna.nosys=true'
- '-Dlog4j2.disable.jmx=true'
- '-Dlog4j.shutdownHookEnabled=false'
- '-server'
- '-Xss1m'
- '-XX:+AlwaysPreTouch'
- '-XX:CMSInitiatingOccupancyFraction=75'
- '-XX:+HeapDumpOnOutOfMemoryError'
- '-XX:-OmitStackTraceInFastThrow'
- '-XX:+UseCMSInitiatingOccupancyOnly'
elasticsearch::license: ~
elasticsearch::logdir: /var/log/elasticsearch
elasticsearch::logging_config: {}
Expand Down Expand Up @@ -69,3 +84,5 @@ elasticsearch::templates: {}
elasticsearch::users: {}
elasticsearch::validate_tls: true
elasticsearch::version: false
elasticsearch::xms: '2g'
elasticsearch::xmx: '2g'
27 changes: 18 additions & 9 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# @author Tyler Langlois <[email protected]>
# @author Gavin Williams <[email protected]>
#
class elasticsearch::config {
class elasticsearch::config inherits elasticsearch {

#### Configuration

Expand Down Expand Up @@ -182,14 +182,23 @@
mode => '0440',
}

# Add any additional JVM options
$elasticsearch::jvm_options.each |String $jvm_option| {
file_line { "jvm_option_${jvm_option}":
ensure => present,
path => "${elasticsearch::configdir}/jvm.options",
line => $jvm_option,
notify => $elasticsearch::_notify_service,
}
# JVM options
$jvm_options_template = @(EOF)
# FILE MANAGED BY PUPPET - DO NOT MODIFY

<% @jvm_options.flatten.each do|jvm_option| -%>
<%= jvm_option %>
<% end -%>
-Xms<%= @xms %>
-Xmx<%= @xmx %>
| EOF

file { "${elasticsearch::configdir}/jvm.options":
ensure => file,
content => inline_template($jvm_options_template),
group => $elasticsearch::elasticsearch_group,
notify => $elasticsearch::_notify_service,
owner => $elasticsearch::elasticsearch_user,
}

if $elasticsearch::system_key != undef {
Expand Down
8 changes: 8 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@
# @param version
# To set the specific version you want to install.
#
# @param xms
# JVM minimum memory (should match xmx, or max).
#
# @param xmx
# JVM maximum memory (should match xms).
#
# @author Richard Pijnenburg <[email protected]>
# @author Tyler Langlois <[email protected]>
# @author Gavin Williams <[email protected]>
Expand Down Expand Up @@ -400,6 +406,8 @@
Hash $users,
Boolean $validate_tls,
Variant[String, Boolean] $version,
String $xms,
String $xmx,
Optional[Stdlib::Absolutepath] $ca_certificate = undef,
Optional[Stdlib::Absolutepath] $certificate = undef,
String $default_logging_level = $logging_level,
Expand Down
19 changes: 0 additions & 19 deletions spec/acceptance/nodesets/centos-6-x64.yml

This file was deleted.

23 changes: 0 additions & 23 deletions spec/acceptance/nodesets/debian-8-x64.yml

This file was deleted.

19 changes: 0 additions & 19 deletions spec/acceptance/nodesets/oracle-6-x64.yml

This file was deleted.

24 changes: 0 additions & 24 deletions spec/acceptance/nodesets/ubuntu-server-1404-x64.yml

This file was deleted.

39 changes: 3 additions & 36 deletions spec/classes/000_elasticsearch_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
let(:pkg_prov) { 'dpkg' }
let(:version_add) { '' }
if (facts[:os]['name'] == 'Debian' and \
facts[:os]['release']['major'].to_i >= 8) or \
facts[:os]['release']['major'].to_i >= 9) or \
(facts[:os]['name'] == 'Ubuntu' and \
facts[:os]['release']['major'].to_i >= 15)
facts[:os]['release']['major'].to_i >= 16)
let(:systemd_service_path) { '/lib/systemd/system' }
test_pid = true
else
Expand All @@ -41,7 +41,7 @@
let(:pkg_prov) { 'rpm' }
let(:version_add) { '-1' }
if facts[:os]['name'] == 'OpenSuSE' and
facts[:os]['release']['major'].to_i <= 12
facts[:os]['release']['major'].to_i >= 12
let(:systemd_service_path) { '/lib/systemd/system' }
else
let(:systemd_service_path) { '/usr/lib/systemd/system' }
Expand Down Expand Up @@ -335,28 +335,6 @@
.with(:owner => 'myesuser', :group => 'myesgroup') }
end

describe 'setting jvm_options' do
jvm_options = [
'-Xms16g',
'-Xmx16g'
]

let(:params) do
default_params.merge(
:jvm_options => jvm_options
)
end

jvm_options.each do |jvm_option|
it { should contain_file_line("jvm_option_#{jvm_option}")
.with(
:ensure => 'present',
:path => '/etc/elasticsearch/jvm.options',
:line => jvm_option
)}
end
end

context 'with restart_on_change => true' do
let(:params) do
default_params.merge(
Expand All @@ -368,17 +346,6 @@
it { should contain_file('/etc/elasticsearch/elasticsearch.yml')
.that_notifies('Service[elasticsearch]')}
end

describe 'setting jvm_options triggers restart' do
let(:params) do
super().merge(
:jvm_options => ['-Xmx16g']
)
end

it { should contain_file_line('jvm_option_-Xmx16g')
.that_notifies('Service[elasticsearch]')}
end
end

# This check helps catch dependency cycles.
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/003_elasticsearch_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:supported_os => [
{
'operatingsystem' => 'CentOS',
'operatingsystemrelease' => ['6']
'operatingsystemrelease' => ['7']
}
]
).each do |os, facts|
Expand Down
Loading