Upgrade nodejs to the latest version from the repo

This is possible in newer versions of the nodejs cookbook, by setting
the `node["nodejs"]["package_action"]["nodejs"]` attribute to `:upgrade`
This commit is contained in:
Greg Karékinian
2021-03-30 13:58:55 +02:00
parent 9fc49deafe
commit edf2e071e4
18 changed files with 234 additions and 77 deletions

View File

@@ -1,12 +1,12 @@
case node['platform_family']
when 'debian'
default['nodejs']['install_repo'] = true
default['nodejs']['repo'] = 'https://deb.nodesource.com/node_6.x'
default['nodejs']['repo'] = 'https://deb.nodesource.com/node_10.x'
default['nodejs']['keyserver'] = 'keyserver.ubuntu.com'
default['nodejs']['key'] = '1655a0ab68576280'
when 'rhel', 'amazon'
when 'rhel', 'fedora', 'amazon'
default['nodejs']['install_repo'] = true
release_ver = platform?('amazon') ? 6 : node['platform_version'].to_i
default['nodejs']['repo'] = "https://rpm.nodesource.com/pub_6.x/el/#{release_ver}/$basearch"
default['nodejs']['repo'] = "https://rpm.nodesource.com/pub_10.x/el/#{release_ver}/$basearch"
default['nodejs']['key'] = 'https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL'
end