From f627f19d22163432f5ade68c172a456beb2efa15 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Sat, 28 Oct 2023 19:28:04 +0200 Subject: [PATCH] stronger allow_virtual guard --- manifests/install.pp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/manifests/install.pp b/manifests/install.pp index ecb27364..993bb817 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -45,9 +45,16 @@ # npm if $nodejs::npm_package_name and $nodejs::npm_package_name != false { + # the nodesource nodejs packages provide "npm" which makes Puppet + # try to uninstall them again + if $nodejs::npm_package_ensure == absent and $nodejs::manage_package_repo == true and $nodejs::repo_class == 'nodejs::repo::nodesource' { + $allow_virtual = false + } else { + $allow_virtual = undef + } package { $nodejs::npm_package_name: ensure => $nodejs::npm_package_ensure, - allow_virtual => false, + allow_virtual => $allow_virtual, tag => 'nodesource_repo', } }