In theory a composite namevar could be used if you just specify the
provider.

For instance, on a Red Hat system:

package { 'foo': ensure => 'latest' } ==> namevar == foo:yum

And

package { 'foo': ensure => 'latest', provider => 'gem' } ==> namevar ==
foo:gem

That said, I never could get composite namevars to work this way. I always
had to have a unique name which ended up in something silly like package {
'foo_rpm':} or package { 'foo_gem':} which, while it should work, is
absolutely horrible to read.

Trevor


On Sat, Mar 8, 2014 at 3:48 PM, Pedro Côrte-Real <pe...@pedrocr.net> wrote:

> On Fri, Mar 7, 2014 at 10:15 PM, Adrien Thebo <adr...@puppetlabs.com>
> wrote:
> > Long story short, allowing multiple resources to exist with the same
> title
> > but different providers is problematic.
>
> There's no reason to need to do that though. Package just needs to be
> able to override the package name without changing $name as that needs
> to be unique. So you should be able to do something like:
>
> package { 'somepackage-in-apt': ensure => present, pkgname =>
> 'somepackage', provider => apt, } package { 'somepackage-in-gem':
> ensure => absent, pkgname => 'somepackage', provider => gem, }
>
> Since we've used $pkgname instead of $name this doesn't have the
> uniqueness issue. I've looked around the code and this seems easy
> enough to do. The Package providers just need to do "pkgname ||= name"
> so the older stuff doesn't break.
>
> Can anyone find any fault with this solution? I've commented on these
> bug reports a lot of times and never gotten any answer to this. It
> seems pretty amazing that this bug still exists after so many years.
>
> Pedro
>
> --
> 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/CALprHx8hEvtyhMkwU1rKbhPXuWZt8NgVdiEu657-krix6d2nUg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
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%2BFoWk47Xb0DbEwPKjbJT80drjWDTSm39JbX8-82s%2Bcx6xTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to