From 5ff0a2e4bbeb8d6363d3b8b8d1efa49fd5a101b0 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) --- .../nodesource/NODESOURCE-GPG-SIGNING-KEY-EL | 51 ++++++++++--------- manifests/repo/nodesource.pp | 34 +------------ manifests/repo/nodesource/apt.pp | 7 +-- manifests/repo/nodesource/yum.pp | 27 ---------- 4 files changed, 29 insertions(+), 90 deletions(-) diff --git a/files/repo/nodesource/NODESOURCE-GPG-SIGNING-KEY-EL b/files/repo/nodesource/NODESOURCE-GPG-SIGNING-KEY-EL index 6c53eb0d..f385c258 100644 --- a/files/repo/nodesource/NODESOURCE-GPG-SIGNING-KEY-EL +++ b/files/repo/nodesource/NODESOURCE-GPG-SIGNING-KEY-EL @@ -1,29 +1,30 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 -mQINBFQCN9QBEADv5QYOlCWNkI/oKST/GGpQkOZjFY2cbYdHuc2j8kyM4oeNluXq -puEYMHOoQvbJ3DFPvsv+jCruL7qjkel9YzaF6e3RN2ystP4YBjxyOT7Bb5EnjNNU -6oScQJ50/+RmA4N3wzBrw5+x5KQGBfRU/k7JdDKO6SGY0zzdAo3jqp1nQ9Sf+Fmg -hsjDLVZTHorLPV3yPLb37QlvBB2YIRF+dL9l4wPAI/fGyWv+Qs7VlCZTyRAnKGbv -qN1LvlYoV9YqxaJYYJW+MQhn4706yNJAFeOZuKejEcnZTd/NBiAR91sVnsXKgW9e -yb4TZ7SqkmrJpuKJBpdPr1dgaK8dDmFh9Nlhpz6xZuYcKaDEDa5b3wymnixtwZf2 -WyboChIlsHDajtXZt34xP9uUge1VHyk1o8AQUzKEpuepxxLnyXArLgvHaLhQnxPA -bQB43b4RbWYHPdB16ki2WoZX/DA4YEtfxg8GC3zXC2thMJnFburmts71iiYsxKBc -6d7O8415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zKQWxFsbCAPIHoWv7rH9RSxgDithXtG6Yg5R1aeBbJaPNXL9wpJ +YBJbiMjkAFaz4B95FOqZm3r7oHugiCGsHX0AEQEAAYkBHwQYAQIACQUCV0M3UAIb +DAAKCRAvWbX5mxvgtE/OB/0VN88DR3Y3fuqy7lq/dthkn7Dqm9YXdorZl3L152eE +IF882aG8FE3qZdaLGjQO4oShAyNWmRfSGuoH0XERXAI9n0r8m4mDMxE6rtP7tHet +y/5M8x3CTyuMgx5GLDaEUvBusnTD+/v/fBMwRK/cZ9du5PSG4R50rtst+oYyC2ao +x4I2SgjtF/cY7bECsZDplzatN3gv34PkcdIg8SLHAVlL4N5tzumDeizRspcSyoy2 +K2+hwKU4C4+dekLLTg8rjnRROvplV2KtaEk6rxKtIRFDCoQng8wfJuIMrDNKvqZw +FRGt7cbvW5MCnuH8MhItOl9Uxp1wHp6gtav/h8Gp6MBa +=MARt -----END PGP PUBLIC KEY BLOCK----- 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..a525c43f 100644 --- a/manifests/repo/nodesource/apt.pp +++ b/manifests/repo/nodesource/apt.pp @@ -1,25 +1,20 @@ # 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 if ($ensure != 'absent') { apt::source { 'nodesource': - include => { - 'src' => $enable_src, - }, key => { 'id' => '9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280', 'source' => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key', }, location => "https://deb.nodesource.com/node_${url_suffix}", pin => $pin, - release => $release, + release => 'nodistro', repos => 'main', } diff --git a/manifests/repo/nodesource/yum.pp b/manifests/repo/nodesource/yum.pp index be31b8e6..e98e4859 100644 --- a/manifests/repo/nodesource/yum.pp +++ b/manifests/repo/nodesource/yum.pp @@ -2,19 +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', - default => '0', - } $yum_failovermethod = (versioncmp($facts['os']['release']['major'], '8') >= 0 and $priority == 'absent') ? { true => 'absent', @@ -52,21 +44,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 +58,6 @@ ensure => 'absent', } - yumrepo { 'nodesource-source': - ensure => 'absent', - } - if versioncmp($facts['os']['release']['major'], '8') >= 0 { file { 'dnf_module': ensure => absent,