How can I install two packages with the same name, but two different providers in the puppet?

I am trying to establish two things:

A PHP-PECL module called "mongo" and a yum package called "mongo". They will need to use the "name" variable to find out what the real name of the package is, but the alias puppet creating this name makes it impossible to access multiple providers.

I knew that I would have to give them different resource names, so naturally I did this:

package { "php-mongo" :
    ensure   => installed,
    provider => 'pecl',
    name     => 'mongo'
}

package { "yum-mongo" :
    ensure   => installed,
    provider => 'yum',
    name     => 'mongo'
}

Because I get the error:

Cannot alias Package[php-mongo] to ["mongo"] at /etc/puppet/environments/testing/modules/packages/manifests/install.pp:52; resource ["Package", "mongo"] already declared at /etc/puppet/environments/testing/modules/packages/manifests/install.pp:52

How can I make this work without fixing stdlib? Do I need to fix my providers instead, so they can remove the added "php-" if I include it in the name to avoid conflict? That seems stupid!

, , !

1398

!

+4
1

Exec . , , .

+3

All Articles