-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
Modulesync 5.4.0 #418
Modulesync 5.4.0 #418
Conversation
78b5c51
to
f48ef6c
Compare
@@ -43,7 +43,7 @@ | |||
$source = undef, | |||
$ensure = present, | |||
$environment = [], | |||
String $user = $logstash::logstash_user, | |||
String $user = 'root', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package installs logstash as root and logstash-plugin command needs access to /usr/share/logstash/Gemfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a bit tricky. will this break existing installations or did it never work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use any plugins and I really don't know logstash that well.
But I do not see how this could ever have worked.
The default $logstash::logstash_user is not created by the module, its created by the package.
The package installs logstash at /usr/share/logstash with root as owner.
$logstash_user is only used to run the service.
Even if someone has a profile class that changes the ownership of /usr/share/logstash and they don't override the $user param, new plugins will be installed with root as owner but I do think logstash running as a less privileged user will still have read access to the installed plugin.
Might be a good idea to mention this in the release notes though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bastelfreak have a look at #413
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thebeanogamer do you have any input here?
@@ -16,7 +16,6 @@ | |||
} | |||
|
|||
$default_startup_options = { | |||
'JAVACMD' => '/usr/bin/java', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this to use the jdk installed by the package.
manifests/service.pp
Outdated
'-XX:+UseCMSInitiatingOccupancyOnly', | ||
'-XX:+UseConcMarkSweepGC', | ||
'-XX:+UseParNewGC', | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was never used. The same default are in the template ..
@@ -4,7 +4,7 @@ | |||
|
|||
shared_examples 'a logstash installer' do | |||
it "installs logstash version #{LS_VERSION}" do | |||
expect(shell('/usr/share/logstash/bin/logstash --version').stdout).to eq("logstash #{LS_VERSION}\n") | |||
expect(shell('/usr/share/logstash/bin/logstash --version').stdout).to contain("logstash #{LS_VERSION}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logstash --version now prints the jdk used as well as the version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is actually a bit tricky to have in shared_examles since it is used in examples that install the latest version available in the yum repo, and it will fail whenever elastic releases a new patch release ...
I had to update the default LS_VERSION in helpers.rb to make the test pass.
@@ -209,8 +210,6 @@ | |||
'-XX:+DisableExplicitGC', | |||
'-XX:+HeapDumpOnOutOfMemoryError', | |||
'-XX:+UseCMSInitiatingOccupancyOnly', | |||
'-XX:+UseConcMarkSweepGC', | |||
'-XX:+UseParNewGC', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsupported java options.
remove_logstash | ||
install_logstash('status => "disabled", restart_on_change => false') | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to be able to run this spec file alone
@@ -5,7 +5,7 @@ | |||
describe 'class patternfile' do | |||
def apply_pattern(pattern_number, extra_logstash_class_args = nil) | |||
manifest = <<-END | |||
#{install_logstash_from_local_file_manifest(extra_logstash_class_args)} | |||
#{install_logstash_manifest(extra_logstash_class_args)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Install from repo so that the tests could be run separatly
c0b87b7
to
c936be5
Compare
@bastelfreak could you please have a look at this. |
spec/defines/define_plugin_spec.rb
Outdated
@@ -7,17 +9,19 @@ | |||
facts | |||
end | |||
|
|||
let(:pre_condition) { %q( | |||
let(:pre_condition) do | |||
' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For multi line strings I'd suggest heredoc
<<~PUPPET
include elastic_stack::repo
include logstash
PUPPET
spec/support/acceptance/helpers.rb
Outdated
PUPPET_VERSION = ENV['PUPPET_VERSION'] || '4.10.7' | ||
|
||
PE_VERSION = ENV['BEAKER_PE_VER'] || ENV['PE_VERSION'] || '3.8.3' | ||
PE_DIR = ENV['BEAKER_PE_DIR'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed IMHO. If it's still used, it should be refactored to be dropped.
spec/support/acceptance/helpers.rb
Outdated
@@ -0,0 +1,239 @@ | |||
# frozen_string_literal: true | |||
|
|||
require 'beaker-rspec' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be part of our generic helper.
spec/support/acceptance/helpers.rb
Outdated
false | ||
end | ||
|
||
def agent_version_for_puppet_version(puppet_version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed. We don't test on Puppet 4 anymore so if it's still called it's redundant.
spec/support/acceptance/helpers.rb
Outdated
def pe_package_url | ||
distro, distro_version = ENV['BEAKER_set'].split('-') | ||
case distro | ||
when 'debian' | ||
os = 'debian' | ||
arch = 'amd64' | ||
when 'centos' | ||
os = 'el' | ||
arch = 'x86_64' | ||
when 'ubuntu' | ||
os = 'ubuntu' | ||
arch = 'amd64' | ||
end | ||
url_root = "https://s3.amazonaws.com/pe-builds/released/#{PE_VERSION}" | ||
"#{url_root}/puppet-enterprise-#{PE_VERSION}-#{os}-#{distro_version}-#{arch}.tar.gz" | ||
end | ||
|
||
def pe_package_filename | ||
File.basename(pe_package_url) | ||
end | ||
|
||
def puppet_enterprise? | ||
ENV['BEAKER_IS_PE'] == 'true' || ENV['IS_PE'] == 'true' | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support Puppet Enterprise in our CI so this should be dropped.
I'll also note that our current modulesync config is at 5.3.0 so perhaps you could also include that. If you need help with that, please let me know. |
c936be5
to
6022ddc
Compare
f3b7422
to
0230b27
Compare
@ekohl I have fixed your comments now and I had a look at https://github.com/voxpupuli/modulesync_config to see if I could fix that as well. |
Hmm, it seems like puppet-logstash is missing in https://github.com/voxpupuli/modulesync_config/blob/master/managed_modules.yml |
@ekohl, @bastelfreak Could you please have another look at this? |
Should README.md have been updated according to the elastic -> voxpupuli transition and logstash version constraints adjusted to supported versions? |
@h-haaks yes (in a separate pull request). |
The differences between 5.3.0 and 5.4.0 are trivial so I'd include that here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally I'm not too happy about making changes in the code itself in a modulesync PR, but if it gets the module moving forward I'm happy to approve.
IS_PRERELEASE = if LS_VERSION =~ %r{(alpha|beta|rc)} | ||
true | ||
else | ||
false | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IS_PRERELEASE = if LS_VERSION =~ %r{(alpha|beta|rc)} | |
true | |
else | |
false | |
end | |
IS_PRERELEASE = LS_VERSION.match?(%r{(alpha|beta|rc)}) |
Is it ok to run msync from the master branch before the 5.4.0 tag is created? |
I do agree. All of this is just parts of transitioning this module into voxpupuli, I think. The modulesync commits are just part of that. |
I think @bastelfreak forgot to push a tag because he did create voxpupuli/modulesync_config@2f1495f so just go for it. |
@ekohl I don't have write access to the repository. Could you please merge this PR? |
Thanks for taking this over the finish. |
No description provided.