Hi everyone,

As I was browsing through a few modules on the Forge I noticed that more 
and more people seem to have taken to the `if ! defined(Package['name']) 
{}` to ensure their module doesn't cause a duplicate resource declaration 
with another module, third party or your own, that is also managing that 
package.

>From a purist perception this should never happen in the first place as 
there are suddenly two modules declaring the same resource. Unfortunately 
this is often what it comes down to when you pull in a few modules from the 
Forge or Github, especially with things like build-essential that a 
multitude of different things might need. In turn this makes using 
third-party modules more difficult because they might introduce issues like 
these that, especially for newcomers to the platform, are troublesome to 
fix.

I was hoping we could devise a solution, at least for package resources, 
that would allow multiple declarations of the package and have those 
declarations resolve themselves. I'm specifically focussing on package here 
because that's the most common source of trouble, things like an rbenv, rvm 
and pyenv module all declaring that they need 'build-essential'.

My initial thought was that a package could have two states, hard and soft 
where a state => hard, definition of a package would always trump any other 
definitions of a package in a soft state. The question then becomes, how do 
you deal with multiple soft states of the same package which basically 
boils down to you can't have multiple declarations of the same thing, so 
we're back to square one.

My other thought was that perhaps it should be possible to `require => 
Package['name']` from any resource and if that resource isn't declared in 
the catalog spawn the resource ourselves but if it is defined that 
declaration is used. I'm not sure how we could deal with scenario's where 
someone requires said package but we explicitly define it as absent in our 
manifests.

Please spare me the "they're being wrong on the internet" speech, I'm well 
aware of it but the truth of the matter is you'll never be able to 
coordinate the community in such a way that this issue doesn't pop up. I'm 
not really concerned about experienced Puppet users/developers that can 
solve this for themselves, more about the less developer oriented operator 
that has to use Puppet for whatever reason. Another approach would be to 
really curate the modules up on the Forge but I doubt anyone feels like 
doing that or has the time for it.

I'm not sure if it's even desirable or possible to solve this issue in the 
first place but I was curious if anyone has given any more thought to this?

-- 
Daniele Sluijters

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/234c5510-c2b2-4786-ac76-68a73bf55e7d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to