Skip to content

Commit

Permalink
default to 16.x on el7
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Oct 27, 2023
1 parent 84612db commit ecff085
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
5 changes: 4 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
$repo_proxy_password = 'absent'
$repo_proxy_username = 'absent'
$repo_release = undef
$repo_url_suffix = '18.x'
$repo_url_suffix = ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7') ? {
true => '16.x',
default => '18.x',
}
$use_flags = ['npm', 'snapshot']

$cmd_exe_path = $facts['os']['family'] ? {
Expand Down
23 changes: 7 additions & 16 deletions spec/classes/nodejs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,25 +292,16 @@
end
end

['7.0', '27'].each do |operatingsystemrelease|
['7.0'].each do |operatingsystemrelease|
osversions = operatingsystemrelease.split('.')
operatingsystemmajrelease = osversions[0]

if operatingsystemmajrelease == '7'
operatingsystem = 'CentOS'
dist_type = 'el'
repo_baseurl = "https://rpm.nodesource.com/pub_18.x/#{dist_type}/#{operatingsystemmajrelease}/$basearch"
repo_source_baseurl = "https://rpm.nodesource.com/pub_18.x/#{dist_type}/#{operatingsystemmajrelease}/SRPMS"
repo_descr = "Node.js Packages for Enterprise Linux #{operatingsystemmajrelease} - $basearch"
repo_source_descr = "Node.js for Enterprise Linux #{operatingsystemmajrelease} - $basearch - Source"
else
operatingsystem = 'Fedora'
dist_type = 'fc'
repo_baseurl = "https://rpm.nodesource.com/pub_18.x/#{dist_type}/#{operatingsystemmajrelease}/$basearch"
repo_source_baseurl = "https://rpm.nodesource.com/pub_18.x/#{dist_type}/#{operatingsystemmajrelease}/SRPMS"
repo_descr = "Node.js Packages for Fedora Core #{operatingsystemmajrelease} - $basearch"
repo_source_descr = "Node.js for Fedora Core #{operatingsystemmajrelease} - $basearch - Source"
end
operatingsystem = 'CentOS'
dist_type = 'el'
repo_baseurl = "https://rpm.nodesource.com/pub_16.x/#{dist_type}/#{operatingsystemmajrelease}/$basearch"
repo_source_baseurl = "https://rpm.nodesource.com/pub_16.x/#{dist_type}/#{operatingsystemmajrelease}/SRPMS"
repo_descr = "Node.js Packages for Enterprise Linux #{operatingsystemmajrelease} - $basearch"
repo_source_descr = "Node.js for Enterprise Linux #{operatingsystemmajrelease} - $basearch - Source"

context "when run on #{operatingsystem} release #{operatingsystemrelease}" do
let :facts do
Expand Down

0 comments on commit ecff085

Please sign in to comment.