Skip to content

Commit

Permalink
only ensure real npm packages
Browse files Browse the repository at this point in the history
nodesource's `nodejs` packages have `Provides: npm` which means that when
we try to `ensure => absent` the `npm` package, it really removes the
`nodejs` package we want.

by setting `allow_virtual => false` we ensure that we only remove real
packages.

Fixes: 160ea93
  • Loading branch information
evgeni committed Oct 28, 2023
1 parent ff1fd3f commit c2d5e79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@
# npm
if $nodejs::npm_package_name and $nodejs::npm_package_name != false {
package { $nodejs::npm_package_name:
ensure => $nodejs::npm_package_ensure,
tag => 'nodesource_repo',
ensure => $nodejs::npm_package_ensure,
allow_virtual => false,
tag => 'nodesource_repo',
}
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
$nodejs_dev_package_name = 'nodejs-devel'
$nodejs_dev_package_ensure = 'absent'
$nodejs_package_name = 'nodejs'
$npm_package_ensure = 'present'
$npm_package_ensure = 'absent'
$npm_package_name = 'npm'
$npm_path = '/usr/bin/npm'
$repo_class = 'nodejs::repo::nodesource'
Expand Down

0 comments on commit c2d5e79

Please sign in to comment.