-
Notifications
You must be signed in to change notification settings - Fork 568
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
Add "basic" OpenBSD support #658
Conversation
@@ -13,7 +17,11 @@ def self.home_dir | |||
|
|||
# @return [String] Full path to the Jenkins user's plugin directory | |||
def self.plugins_dir | |||
return File.join(self.home_dir, 'plugins') | |||
if Facter.value(:osfamily) == 'OpenBSD' |
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.
In digging into these test errors, I have discovered that this use of Facter
causes issues with how the tests are currently written.
Basically Facter
uses File#directory?
which is mocked out entirely
I believe the appropriate behavior is to also mock Facter#value
with an expectation
Jenkins installed via the jenkins package is a bit different on OpenBSD than on other Linux that were supported so far. Major differences: * jenkins system user/group is called _jenkins * jenkins users home directory is /var/jenkins, but the state and everything related to Jenkins is stored under /var/jenkins/.jenkins, i.e. /var/jenkins/.jenksin/plugins Therefore following changes: lib/puppet/jenkins.rb * figure out the jenkins home_dir based on the _jenkins user * point the plugins_dir to $home_dir/.jenkins/plugins lib/puppet/jenkins/facts.rb * confine the jenkins_plugins fact to OpenBSD too manifests/init.pp * add a service_flags parameter, to hand over flags for the jenkins service * while there, remove some redundant documentation of user/group parameters manifests/params.pp * make $user, $group, and $localstatedir dependent on ::osfamily * add a $jarbin variable, pointing to the Java jar binary, for all but OpenBSD, use the short name: 'jar', for OpenBSD, default to the full path where it can be found, overridable via parameter to init.pp * similarily to the $jarbin, add a $javabin variable and use it manifests/repo.pp * add an empty case for OpenBSD, no special handling required jenkins package is in default repos available manifests/service.pp * add a special case for OpenBSD to manage the service. This is necessary, because I've seen with other puppet modules, supporting older puppet versions, that the service_flags parameter might not be understood when it is given. manifests/cli/config.pp * do not hardcode the jenkins user and group * use the $::jenkins::jarbin variable, in order to find the Java jar binary manifests/cli.pp * make use of the $javabin variable instead of hardcoding the java binary manifests/cli_helper.pp * make use of the $javabin variable instead of hardcoding the java binary specs/* * rearrange/add some specs to handle tests for OpenBSD Add javabin parameter, and use it where java binary is used
of the cli tools that take info from the config_hash to find the jenkins port Fixup localstatedir for OpenBSD, point to .jenkins subdir rubocop pleasings
…t in Jenkins::Plugins This is required since Facter#value is going to ultimately start using the File module to dig through the directory structure on disk looking for facts. With the OpenBSD support this is suddenly a problem as we weren't previously looking up facts within these unit tests See also: <https://github.com/jenkinsci/puppet-jenkins/pull/658/files#r85852243>
Closing this out, I'm not interested in reviving this yet again 😸 |
This is a respin of #304