Greg Karékinian edf2e071e4 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`
2021-03-30 13:58:55 +02:00

16 lines
688 B
Ruby

include_attribute 'nodejs::default'
include_attribute 'nodejs::repo'
default['nodejs']['packages'] = value_for_platform_family(
'debian' => node['nodejs']['install_repo'] ? ['nodejs'] : %w(nodejs npm nodejs-dev),
%w(rhel fedora amazon) => node['nodejs']['install_repo'] ? %w(nodejs nodejs-devel) : %w(nodejs npm nodejs-dev),
'suse' => node['platform_version'].to_i < 42 ? %w(nodejs10 npm10 nodejs10-devel) : %w(nodejs4 npm4 nodejs4-devel),
'mac_os_x' => ['node'],
'freebsd' => %w(node npm),
'default' => ['nodejs']
)
# Add options and actions by package name
default['nodejs']['package_action'] = { default: :install }
default['nodejs']['package_options'] = { default: '' }