I was talking with a few folks today about potential resolutions to module namespace issues.
== Fundamental Issue == puppetlabs_apache -- Installs To --> apache example42_apache -- Installs To --> apache theforeman_apache -- Installs To --> apache You get my point... == Current Solutions == Right now, there are two ways to solve this problem if you want some of your nodes to use puppetlabs_apache and others to use theforeman_apache. 1) Modify the module and force the namespace: - puppetlabs_apache -- Installs To --> puppetlabs_apache - theforeman_apache -- Installs To --> theforeman_apache * Isssue: You can't just use outside code at will. You have to modify *everything* that uses the above code. 2) You have to create a separate environment for each host group (potentially each host) that you want to have use the differing code. * Issue: This is a LOT of overhead for a couple of modules and may have other ramifications in terms of performance as you get up in number. So, would it be possible to allow multiple versions of a module to exist in the same namespace but only use one during a given run? == The First Proposal == Inspired by RVM Gemsets, how about allowing modules to declare which version of a given module they will use? /etc/puppet/modules/apache/puppetlabs/{files,modules,manifests} /etc/puppet/modules/apache/theforeman/{files,modules,manifests} /etc/puppet/modules/apache/<author>/{files,modules,manifests} Then, use could be dictated by something like: include apache@puppetlabs. Unfortunately, this really comes down to the parser being able to understand the following: include apache => See if there are any @'s and use that one include apache@puppetlabs => include the Puppetlabs apache include apache@puppetlabs && include apache@theforeman => Fail, conflict == Alternative == One possible alternative is to just use the metadata.json file to dictate which module will be used when loading other modules. Again, if there is a conflict, that is a failure but *only* if the code attempts to use both at the same time. The benefit here is that it should make things very unambiguous while the drawback (if it really is) is that you *must* put a metadata.json file in every module that you create. This is just a set of thoughts that I hope get us moving in a direction where this type of thing is possible and I look forward to hearing what people think (good, bad, or ugly)! Thanks, Trevor -- Trevor Vaughan Vice President, Onyx Point, Inc (410) 541-6699 tvaug...@onyxpoint.com -- This account not approved for unencrypted proprietary information -- -- 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 puppet-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CANs%2BFoU2unExPve9ig%3DinW9obDpwii7gBi6W4RkHycViibJp-g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.