-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
Enhance distro support #342
Conversation
@@ -25,7 +26,7 @@ | |||
if $::operatingsystemrelease =~ /^6\.(\d+)/ { | |||
fail("The ${module_name} module is not supported on Debian Squeeze.") | |||
} | |||
elsif $::operatingsystemrelease =~ /^[78]\.(\d+)/ { | |||
elsif $::operatingsystemrelease =~ /^[789]\.(\d+)/ { |
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.
Wouldn't versioncmp($::operatingsystemmajrelease, '7') >= 0
be better and more future proof?
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.
I think that would incorrectly catch the Ubuntu versions as well wouldn't it?
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 will likely break for the next version of Debian (10) as it will start to conflict with Ubuntu 10.x, logic should be broken off separately for Debian and Ubuntu.
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.
You're right. Early morning code reviews aren't the best idea :P
manifests/repo/nodesource/apt.pp
Outdated
|
||
ensure_packages(['apt-transport-https', 'ca-certificates']) | ||
|
||
include ::apt | ||
|
||
if empty($release) { |
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.
Would pick($release, $::lsbdistcodename)
be better here or is this another case of me missing anything? :)
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.
Didn't know about pick, you're right!
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.
Looks good.
Note: the failing travis checks appears to be because of missing nodejs-dev package, but the managed nodejs repo doesn't seem to provide this package - headers are included in the main nodejs package by the look of it. |
@@ -11,6 +11,7 @@ | |||
$repo_proxy_password = 'absent' | |||
$repo_proxy_username = 'absent' | |||
$repo_url_suffix = '0.10' | |||
$repo_release = undef |
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.
It's clearer if you default to $::lsbdistcodename here and remove the pick() later, no?
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.
But that fact is undefined on many OSes so I'm assuming he didn't want to break strict variables. On Debian it is defined so you can safely use it with pick()
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.
As per voxpupuli/puppet-nginx#1154 (comment), changing to pass $repo_release through unaltered and let apt module deal with undef release.
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.
manifests/init.pp
Outdated
@@ -23,6 +23,7 @@ | |||
$repo_proxy_password = $nodejs::params::repo_proxy_password, | |||
$repo_proxy_username = $nodejs::params::repo_proxy_username, | |||
$repo_url_suffix = $nodejs::params::repo_url_suffix, | |||
$repo_release = $nodejs::params::repo_release, |
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.
Please add an entry to the README for this
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 README entry
40f96bb
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.
Can you add a datatype for the new param?
Have stolen the relevant bits in this change and put them in #349 |
Add explicit Debian 9 (stretch) support, and add support for Ubilinux.
Ubilinux 4 (that supports all variants of the Up boards) is a derivative of Debian 9. However it reports dolcetto as the lsbdistcodename instead of stretch so the nodejs repo fails. This PR adds support for a $nodejs::repo_release parameter that allows the distro code name to be specified rather than blindly taking it from lsbdistcodename.
eg.: