diff --git a/README.md b/README.md index 1536a09a..1bcc32d4 100644 --- a/README.md +++ b/README.md @@ -488,6 +488,16 @@ that were available on 2017-11-14: * Fedora 25 ```4.x``` ```6.x``` ```7.x``` ```8.x``` ```9.x``` * Fedora 26 ```6.x``` ```8.x``` ```9.x``` +#### `repo_release` + +Option to override the apt distro release. Defaults to undef which will +autodetect the distro, if specified will influence the apt repo distro. +This is useful if the distro name does not exist in the nodejs repos, for +example a derivative distribution. +eg. Ubilinux 4 distro release name is 'dolcetto' which does not exist in +nodejs repos, but is a derivative of Debian 9 'stretch'. Setting this +param to 'stretch' therefore allows this repo management to work as expected. + #### `use_flags` The USE flags to use for the Node.js package on Gentoo systems. Defaults to diff --git a/manifests/init.pp b/manifests/init.pp index 53f85124..f39ee0c8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, + Optional[String] $repo_release = $nodejs::params::repo_release, Array $use_flags = $nodejs::params::use_flags, ) inherits nodejs::params { diff --git a/manifests/params.pp b/manifests/params.pp index e3f76a08..8912aeac 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -11,6 +11,7 @@ $repo_proxy_password = 'absent' $repo_proxy_username = 'absent' $repo_url_suffix = '0.10' + $repo_release = undef $use_flags = ['npm', 'snapshot'] # The full path to cmd.exe is required on Windows. The system32 fact is only @@ -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+)/ { $legacy_debian_symlinks = false $manage_package_repo = true $nodejs_debug_package_name = 'nodejs-dbg' diff --git a/manifests/repo/nodesource.pp b/manifests/repo/nodesource.pp index a380faf5..2eb1fe3e 100644 --- a/manifests/repo/nodesource.pp +++ b/manifests/repo/nodesource.pp @@ -8,6 +8,7 @@ $proxy_password = $nodejs::repo_proxy_password $proxy_username = $nodejs::repo_proxy_username $url_suffix = $nodejs::repo_url_suffix + $release = $nodejs::repo_release case $::osfamily { 'RedHat': { diff --git a/manifests/repo/nodesource/apt.pp b/manifests/repo/nodesource/apt.pp index c5f336fc..62c7f777 100644 --- a/manifests/repo/nodesource/apt.pp +++ b/manifests/repo/nodesource/apt.pp @@ -5,6 +5,7 @@ $ensure = $nodejs::repo::nodesource::ensure $pin = $nodejs::repo::nodesource::pin $url_suffix = $nodejs::repo::nodesource::url_suffix + $release = $nodejs::repo::nodesource::release ensure_packages(['apt-transport-https', 'ca-certificates']) @@ -21,7 +22,7 @@ }, location => "https://deb.nodesource.com/node_${url_suffix}", pin => $pin, - release => $::lsbdistcodename, + release => $release, repos => 'main', require => [ Package['apt-transport-https'],