From 6077460d9b2a6012dee3eb02ae43a9c6060e39be Mon Sep 17 00:00:00 2001 From: mbakerbp Date: Fri, 10 Mar 2017 07:20:16 +0800 Subject: Should only try to aplpy the resource if it not defined --- lib/puppet/parser/functions/ensure_packages.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/puppet') diff --git a/lib/puppet/parser/functions/ensure_packages.rb b/lib/puppet/parser/functions/ensure_packages.rb index 439af1e..6c59b20 100644 --- a/lib/puppet/parser/functions/ensure_packages.rb +++ b/lib/puppet/parser/functions/ensure_packages.rb @@ -37,7 +37,9 @@ third argument to the ensure_resource() function. Puppet::Parser::Functions.function(:ensure_resource) packages.each { |package_name| + if !findresource("Package[#{package_name}]") function_ensure_resource(['package', package_name, defaults ]) + end } end end -- cgit v1.2.3