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

Enhance distro support #342

Closed
wants to merge 7 commits into from
Closed

Enhance distro support #342

wants to merge 7 commits into from

Conversation

fnoop
Copy link
Contributor

@fnoop fnoop commented Nov 18, 2017

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.:

    class { 'nodejs':
        repo_url_suffix => '8.x',
        repo_release    => 'stretch',
        nodejs_package_ensure => latest,
    }

@fnoop fnoop changed the title Add Debian 9 to params Enhance distro support Nov 18, 2017
@@ -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+)/ {
Copy link
Member

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?

Copy link
Contributor Author

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?

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 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.

Copy link
Member

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


ensure_packages(['apt-transport-https', 'ca-certificates'])

include ::apt

if empty($release) {
Copy link
Member

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? :)

Copy link
Contributor Author

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!

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.

Looks good.

@fnoop
Copy link
Contributor Author

fnoop commented Nov 18, 2017

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
Copy link
Member

@juniorsysadmin juniorsysadmin Nov 18, 2017

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?

Copy link
Member

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()

Copy link
Contributor Author

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.

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 datatype to new parameter, and pass it straight through apt module in commits fdb655d 63c3d3c

@@ -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,
Copy link
Member

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

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 README entry
40f96bb

Copy link
Member

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?

@juniorsysadmin
Copy link
Member

@fnoop Are you now able rebase on top of master to fix the merge conflicts? (#343 was merged, which had some of your changes)

@juniorsysadmin
Copy link
Member

juniorsysadmin commented Dec 26, 2017

Have stolen the relevant bits in this change and put them in #349

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