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

Modulesync 5.4.0 #418

Merged
merged 16 commits into from
Dec 29, 2022
Merged

Conversation

h-haaks
Copy link
Contributor

@h-haaks h-haaks commented Nov 7, 2022

No description provided.

@h-haaks h-haaks force-pushed the fix-modulesync branch 2 times, most recently from 78b5c51 to f48ef6c Compare November 7, 2022 00:53
@@ -43,7 +43,7 @@
$source = undef,
$ensure = present,
$environment = [],
String $user = $logstash::logstash_user,
String $user = 'root',
Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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',
Copy link
Contributor Author

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.

'-XX:+UseCMSInitiatingOccupancyOnly',
'-XX:+UseConcMarkSweepGC',
'-XX:+UseParNewGC',
]
Copy link
Contributor Author

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}")
Copy link
Contributor Author

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.

Copy link
Contributor Author

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',
Copy link
Contributor Author

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

Copy link
Contributor Author

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)}
Copy link
Contributor Author

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

@h-haaks h-haaks force-pushed the fix-modulesync branch 2 times, most recently from c0b87b7 to c936be5 Compare November 7, 2022 02:01
@h-haaks
Copy link
Contributor Author

h-haaks commented Nov 7, 2022

Fixes #391, #400, #402, #408

@h-haaks
Copy link
Contributor Author

h-haaks commented Nov 7, 2022

@bastelfreak could you please have a look at this.

@h-haaks h-haaks mentioned this pull request Dec 14, 2022
@ekohl ekohl changed the title Fix modulesync Modulesync 5.2.0 Dec 14, 2022
@@ -7,17 +9,19 @@
facts
end

let(:pre_condition) { %q(
let(:pre_condition) do
'
Copy link
Member

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

Comment on lines 10 to 13
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']
Copy link
Member

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.

@@ -0,0 +1,239 @@
# frozen_string_literal: true

require 'beaker-rspec'
Copy link
Member

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.

false
end

def agent_version_for_puppet_version(puppet_version)
Copy link
Member

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.

Comment on lines 216 to 239
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
Copy link
Member

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.

@ekohl
Copy link
Member

ekohl commented Dec 14, 2022

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.

@h-haaks
Copy link
Contributor Author

h-haaks commented Dec 22, 2022

@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.
I think I need some help with this ..

@h-haaks
Copy link
Contributor Author

h-haaks commented Dec 22, 2022

Hmm, it seems like puppet-logstash is missing in https://github.com/voxpupuli/modulesync_config/blob/master/managed_modules.yml

@h-haaks h-haaks changed the title Modulesync 5.2.0 Modulesync 5.3.0 Dec 22, 2022
@h-haaks
Copy link
Contributor Author

h-haaks commented Dec 22, 2022

@ekohl, @bastelfreak Could you please have another look at this?
I think it would be smart to get this merged before the 5.4.0 release of modulesync.

@h-haaks
Copy link
Contributor Author

h-haaks commented Dec 22, 2022

Should README.md have been updated according to the elastic -> voxpupuli transition and logstash version constraints adjusted to supported versions?

@kenyon
Copy link
Member

kenyon commented Dec 22, 2022

@h-haaks yes (in a separate pull request).

@ekohl
Copy link
Member

ekohl commented Dec 22, 2022

I think it would be smart to get this merged before the 5.4.0 release of modulesync.

The differences between 5.3.0 and 5.4.0 are trivial so I'd include that here.

Copy link
Member

@ekohl ekohl left a 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.

Comment on lines +7 to +11
IS_PRERELEASE = if LS_VERSION =~ %r{(alpha|beta|rc)}
true
else
false
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IS_PRERELEASE = if LS_VERSION =~ %r{(alpha|beta|rc)}
true
else
false
end
IS_PRERELEASE = LS_VERSION.match?(%r{(alpha|beta|rc)})

@h-haaks
Copy link
Contributor Author

h-haaks commented Dec 23, 2022

The differences between 5.3.0 and 5.4.0 are trivial so I'd include that here.

Is it ok to run msync from the master branch before the 5.4.0 tag is created?

@h-haaks
Copy link
Contributor Author

h-haaks commented Dec 23, 2022

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.

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'll gladly change the title to something like 'Get module to build with voxpupuli'.

@ekohl
Copy link
Member

ekohl commented Dec 23, 2022

Is it ok to run msync from the master branch before the 5.4.0 tag is created?

I think @bastelfreak forgot to push a tag because he did create voxpupuli/modulesync_config@2f1495f so just go for it.

@h-haaks h-haaks changed the title Modulesync 5.3.0 Modulesync 5.4.0 Dec 29, 2022
@h-haaks
Copy link
Contributor Author

h-haaks commented Dec 29, 2022

@ekohl I don't have write access to the repository. Could you please merge this PR?

@ekohl ekohl merged commit 804e85a into voxpupuli:master Dec 29, 2022
@ekohl
Copy link
Member

ekohl commented Dec 29, 2022

Thanks for taking this over the finish.

@h-haaks h-haaks deleted the fix-modulesync branch December 29, 2022 13:51
This was referenced Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants