voxpupuli / puppet-nodejs

Puppet module to install nodejs and global npm packages
https://forge.puppet.com/puppet/nodejs
Apache License 2.0
113 stars 247 forks source link

expected package source on Ubuntu 16 #309

Closed wyardley closed 5 years ago

wyardley commented 7 years ago

It seems like Ubuntu 16.04 is configuring the nodesource repo:

https://github.com/voxpupuli/puppet-nodejs/blob/master/manifests/params.pp#L83-L86

However, the installed package actually ends up being from the default repo, presumably because it's a different version? I can work on this in #308, but right now, it will fail, because I built in the expectation that the package should come from nodesource. Let's figure out how this should behave, and then we can figure out whether the right fix is adjusting the test or adjusting the module.

root@ubuntu-server-1604-x64:~# cat /etc/apt/sources.list.d/nodesource.list 
# This file is managed by Puppet. DO NOT EDIT.
# nodesource
deb https://deb.nodesource.com/node_0.10 xenial main
root@ubuntu-server-1604-x64:~# apt-get update
Ign:1 http://apt.puppetlabs.com xenial InRelease
Hit:2 http://apt.puppetlabs.com xenial Release                                          
Hit:3 http://us.archive.ubuntu.com/ubuntu xenial InRelease                              
Hit:5 https://deb.nodesource.com/node_0.10 xenial InRelease                             
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]          
Get:8 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Fetched 306 kB in 0s (370 kB/s)                                     
Reading package lists... Done
root@ubuntu-server-1604-x64:~# apt-get install nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nodejs is already the newest version (4.2.6~dfsg-1ubuntu4.1).
0 upgraded, 0 newly installed, 0 to remove and 187 not upgraded.
root@ubuntu-server-1604-x64:~# dpkg -s nodejs
Package: nodejs
Status: install ok installed
Priority: optional
Section: web
Installed-Size: 12930
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Version: 4.2.6~dfsg-1ubuntu4.1
Provides: nodejs-abi-46
Depends: libc6 (>= 2.15), libgcc1 (>= 1:3.4), libicu55 (>= 55.1-1~), libssl1.0.0 (>= 1.0.2~beta3), libstdc++6 (>= 5.2), libuv1 (>= 1.6.1), zlib1g (>= 1:1.1.4)
Description: evented I/O for V8 javascript
 Node.js is a platform built on Chrome's JavaScript runtime for easily
 building fast, scalable network applications. Node.js uses an
 event-driven, non-blocking I/O model that makes it lightweight and
 efficient, perfect for data-intensive real-time applications that run
 across distributed devices.
 .
 Node.js is bundled with several useful libraries to handle server
 tasks:
 .
 System, Events, Standard I/O, Modules, Timers, Child Processes, POSIX,
 HTTP, Multipart Parsing, TCP, DNS, Assert, Path, URL, Query Strings.
Homepage: http://nodejs.org/
Original-Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
wyardley commented 7 years ago

Also similarly: #258 Not so sure if the module should / can enforce the exact source, though it would be cool if there were just an enum to select the source, and the module would ensure that the package came only from that source.

juniorsysadmin commented 7 years ago

Setting the value of nodejs::repo_pin so that it presumably has a higher priority than base might be what you're after.

wyardley commented 7 years ago

@juniorsysadmin I'm mostly trying to figure out what the desired behavior is [i.e., how the module should behave]... then someone can figure out how it should be implemented.

juniorsysadmin commented 7 years ago

@wyardley There might be a bit of confusion with regard to package versioning and repository priorities. I don't think it was the intention to have the NodeSource repo URL directly control the version that gets installed rather than nodejs_package_ensure. I have added #322 to make the docs clearer.

wyardley commented 7 years ago

Yeah, the thing I was trying to get clarity about the expected behavior for was having the acceptance test check the package source. However, it seems like we should probably just not have the acceptance test check the package's source if the goal is not to necessarily have a predictable outcome purely based on what repos are enabled.

I can submit a PR to that effect.

juniorsysadmin commented 5 years ago

Closing due to age, feel free to re-open.