5 Commits

Author SHA1 Message Date
Monty Taylor
e188ce71ca Validate that node_version is set
We removed the default value, because having a default value actually
makes no sense at all. To be helpful for any transitions, add a runtime
check that the variable is set.

Also, while we're at it, update the docs to indicate that the parameter
is required.

Change-Id: I1e18ea51d9d56561608ff241d71b63965c4f78bd
2024-09-19 13:00:26 -07:00
Clark Boylan
efa55f881d Modernize ensure-nodejs
The ensure-nodejs role defaults to install nodejs 6 which produces this
error currently:

  Failed to update apt cache: W:The repository
  'https://deb.nodesource.com/node_6.x noble Release' does not have a
  Release file., W:Data from such a repository can't be authenticated
  and is therefore potentially dangerous to use.

We need to make a few changes to bring this ensure-nodejs role up to
modern expectations for nodesource usage. First we drop the default
nodejs version from ensure-nodejs. Everyone is already setting this
value to make this role work or they are broken and will need to change
something anyway. This gets us off of the nodejs update treadmill in
this role.

Then with nodejs 16 and newer there is a new gpg key and no deb-src
packages so we need to change the apt configuration if using 16 and
newer. We make these changes to match the corresponding setup_16.x etc
scripts from nodesource.

Change-Id: I0d5c93e4fbcee0be2cc477bf9f625e419a2b9bd1
2024-09-18 16:46:00 -07:00
Sorin Sbarnea
7325aca987 More E208 (22)
Change-Id: I8cbb919c39bdb099eaec076c7bcf2ea0b84a6475
2020-11-09 14:40:00 +00:00
Mohammed Naser
7ea6d11981 ensure-nodejs: refactor to use ensure-package-repositories
This patch refactors ensure-nodejs to use the new generic role
to allow it to be cross-platform in the future.

Change-Id: I859b6b3e33bc22ad4f99828e921ac2ed35a49252
2020-05-01 15:49:30 +02:00
vass
ac72b44911 Rename install-nodejs to ensure-nodejs for consistency
The old role will be kept and include ensure-nodejs for backwards-compatability.

Change-Id: Ib4cf74d6c1e8774f6fc37d6a30f690eb8f9f3d08
2020-04-04 15:41:29 -04:00