From b17954e862ab08faa8d2b845e128a57e1ad8a56a Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Sat, 28 Oct 2023 18:04:27 +0200 Subject: [PATCH] switch to using the nodistro nodesource repos the other ones do not contain the latest releases (e.g. 20.x contains 20.5 vs 20.9) --- manifests/repo/nodesource.pp | 34 ++------------------------------ manifests/repo/nodesource/apt.pp | 4 +--- manifests/repo/nodesource/yum.pp | 22 --------------------- 3 files changed, 3 insertions(+), 57 deletions(-) diff --git a/manifests/repo/nodesource.pp b/manifests/repo/nodesource.pp index ac8a52cf..9e434c74 100644 --- a/manifests/repo/nodesource.pp +++ b/manifests/repo/nodesource.pp @@ -12,39 +12,9 @@ case $facts['os']['family'] { 'RedHat': { - if $facts['os']['release']['major'] =~ /^[789]$/ { - $dist_version = $facts['os']['release']['major'] - $name_string = "Enterprise Linux ${dist_version}" - } - - # Fedora - elsif $facts['os']['name'] == 'Fedora' { - $dist_version = $facts['os']['release']['full'] - $name_string = "Fedora Core ${facts['os']['release']['full']}" - } - - # newer Amazon Linux releases - elsif ($facts['os']['name'] == 'Amazon') { - $dist_version = '7' - $name_string = 'Enterprise Linux 7' - } - - else { - fail("Could not determine NodeSource repository URL for operatingsystem: ${facts['os']['name']} operatingsystemrelease: ${facts['os']['release']['full']}.") - } - - $dist_type = $facts['os']['name'] ? { - 'Fedora' => 'fc', - default => 'el', - } - # nodesource repo - $descr = "Node.js Packages for ${name_string} - \$basearch" - $baseurl = "https://rpm.nodesource.com/pub_${url_suffix}/${dist_type}/${dist_version}/\$basearch" - - # nodesource-source repo - $source_descr = "Node.js for ${name_string} - \$basearch - Source" - $source_baseurl = "https://rpm.nodesource.com/pub_${url_suffix}/${dist_type}/${dist_version}/SRPMS" + $descr = "Node.js Packages - \$basearch" + $baseurl = "https://rpm.nodesource.com/pub_${url_suffix}/nodistro/nodejs/\$basearch" contain 'nodejs::repo::nodesource::yum' } diff --git a/manifests/repo/nodesource/apt.pp b/manifests/repo/nodesource/apt.pp index 13528a8a..09f4ac37 100644 --- a/manifests/repo/nodesource/apt.pp +++ b/manifests/repo/nodesource/apt.pp @@ -1,9 +1,7 @@ # PRIVATE CLASS: Do not use directly. class nodejs::repo::nodesource::apt { - $enable_src = $nodejs::repo::nodesource::enable_src $ensure = $nodejs::repo::nodesource::ensure $pin = $nodejs::repo::nodesource::pin - $release = $nodejs::repo::nodesource::release $url_suffix = $nodejs::repo::nodesource::url_suffix include apt @@ -19,7 +17,7 @@ }, location => "https://deb.nodesource.com/node_${url_suffix}", pin => $pin, - release => $release, + release => 'nosource', repos => 'main', } diff --git a/manifests/repo/nodesource/yum.pp b/manifests/repo/nodesource/yum.pp index be31b8e6..78a7f692 100644 --- a/manifests/repo/nodesource/yum.pp +++ b/manifests/repo/nodesource/yum.pp @@ -2,14 +2,11 @@ class nodejs::repo::nodesource::yum { $baseurl = $nodejs::repo::nodesource::baseurl $descr = $nodejs::repo::nodesource::descr - $enable_src = $nodejs::repo::nodesource::enable_src $ensure = $nodejs::repo::nodesource::ensure $priority = $nodejs::repo::nodesource::priority $proxy = $nodejs::repo::nodesource::proxy $proxy_password = $nodejs::repo::nodesource::proxy_password $proxy_username = $nodejs::repo::nodesource::proxy_username - $source_baseurl = $nodejs::repo::nodesource::source_baseurl - $source_descr = $nodejs::repo::nodesource::source_descr $yum_source_enabled = $enable_src ? { true => '1', @@ -52,21 +49,6 @@ require => File['/etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL'], } - yumrepo { 'nodesource-source': - descr => $source_descr, - baseurl => $source_baseurl, - enabled => $yum_source_enabled, - failovermethod => $yum_failovermethod, - gpgkey => 'file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL', - gpgcheck => '1', - module_hotfixes => $module_hotfixes, - priority => $priority, - proxy => $proxy, - proxy_password => $proxy_password, - proxy_username => $proxy_username, - require => File['/etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL'], - } - file { '/etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL': ensure => file, group => '0', @@ -81,10 +63,6 @@ ensure => 'absent', } - yumrepo { 'nodesource-source': - ensure => 'absent', - } - if versioncmp($facts['os']['release']['major'], '8') >= 0 { file { 'dnf_module': ensure => absent,