I'm trying to install two things:
A PHP-PECL module called "mongo", and a package on yum called "mongo". They'll need to use the "name" variable to know what the real name of the package is, but the alias puppet creates using this name is making it impossible to handle more than one provider.
I knew I'd 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 patching stdlib? Do I need to patch my providers instead, so they can remove a prepended "php-" if I include it in the name just to avoid a conflict? That seems dumb!
Upon research, this is an old, old bug, but I'm not finding any way around it!
Bug 1398
Thanks!
Another workaround is to use an Exec to install one of the packages via its respective package management utility. Obviously this is not ideal, but it gets both packages installed without the name conflict.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With