Skip to content

Commit

Permalink
move desc and baseurl into yum class, they are not used otherwise
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Oct 29, 2023
1 parent 72ec4aa commit 4ec819f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions manifests/repo/nodesource.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@

case $facts['os']['family'] {
'RedHat': {
# nodesource repo
$descr = "Node.js Packages - \$basearch"
$baseurl = "https://rpm.nodesource.com/pub_${url_suffix}/nodistro/nodejs/\$basearch"

contain 'nodejs::repo::nodesource::yum'
}
'Debian': {
Expand Down
7 changes: 3 additions & 4 deletions manifests/repo/nodesource/yum.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# PRIVATE CLASS: Do not use directly.
class nodejs::repo::nodesource::yum {
$baseurl = $nodejs::repo::nodesource::baseurl
$descr = $nodejs::repo::nodesource::descr
$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
$url_suffix = $nodejs::repo::nodesource::url_suffix

$yum_failovermethod = (versioncmp($facts['os']['release']['major'], '8') >= 0 and $priority == 'absent') ? {
true => 'absent',
Expand Down Expand Up @@ -38,8 +37,8 @@
# FIXME: REMOVE ABOVE HACK

yumrepo { 'nodesource':
descr => $descr,
baseurl => $baseurl,
descr => 'Node.js Packages - $basearch',
baseurl => "https://rpm.nodesource.com/pub_${url_suffix}/nodistro/nodejs/\$basearch",
enabled => '1',
failovermethod => $yum_failovermethod,
gpgkey => 'file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL',
Expand Down

0 comments on commit 4ec819f

Please sign in to comment.