puppetlabs-ruby icon indicating copy to clipboard operation
puppetlabs-ruby copied to clipboard

switch to ensure_packages()

Open bastelfreak opened this issue 6 years ago • 6 comments

The ruby module is used as a dependency in many other component modules. Some of them also define the ruby package or any of the other packages here. This leads to duplicate resources and a failing catalog. As a workaround I migrated all package resources to ensure_packages() from stdlib and increased the minimal stdlib version from 4.13.1 to 4.19.0.

bastelfreak avatar Nov 15 '18 10:11 bastelfreak

I'm not 100% sure this will help. ensure_packages() uses ensure_resources where parameters still have to match to avoid duplicate resources.

If the resource already exists, but does not match the specified parameters, this function attempts to recreate the resource, leading to a duplicate resource definition error.

alexjfisher avatar Nov 15 '18 10:11 alexjfisher

@alexjfisher correct, it only helps if the parameters are identical. But it should still help alot.

bastelfreak avatar Jun 10 '19 07:06 bastelfreak

Or maybe not help at all. You're specifying a bunch of parameters for each package resource, so these are almost guaranteed not to match existing resources.

But the require and before metaparameters might be handled differently and not need to match. Not sure. Also, if the package is already in the catalog, will the relationships declared in this manifest get used??

alexjfisher avatar Jun 10 '19 08:06 alexjfisher

@alexjfisher updated it, should be much cleaner now :)

bastelfreak avatar Jun 10 '19 10:06 bastelfreak

It would be nice if one could finally review this :)

bastelfreak avatar Feb 24 '20 09:02 bastelfreak

@tphoney I offer to fix those CI issues if you merge the PRs and do a 1.0.0 release afterwards :)

bastelfreak avatar May 26 '20 21:05 bastelfreak