Ah I think this is a duplicate of two other bugs. The issue of puppet resource package hiding packages from multiple providers is PUP-7497. I left a note and potential patch in that ticket. The issue of multiple packages with the same name in a manifest is PUP-5302. Puppet requires the title to be unique, so you have to give it a dummy title and specify the name parameter separately:
[root@wild-enthusiast ~]# cat a.pp |
package { 'uuid': |
ensure => present, |
provider => 'gem' |
} |
|
package { 'uuid': |
ensure => present, |
provider => 'yum' |
} |
[root@wild-enthusiast ~]# puppet apply a.pp |
Error: Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Package[uuid] is already declared at (file: /root/a.pp, line: 1); cannot redeclare (file: /root/a.pp, line: 6) (file: /root/a.pp, line: 6, column: 1) on node wild-enthusiast.delivery.puppetlabs.net |
[root@wild-enthusiast ~]# vi a.pp |
[root@wild-enthusiast ~]# cat a.pp |
package { 'uuid-gem': |
ensure => present, |
name => 'uuid', |
provider => 'gem' |
} |
|
package { 'uuid-yum': |
ensure => present, |
name => 'uuid', |
provider => 'yum' |
} |
[root@wild-enthusiast ~]# puppet apply a.pp |
Notice: Compiled catalog for wild-enthusiast.delivery.puppetlabs.net in environment production in 0.27 seconds |
Notice: /Stage[main]/Main/Package[uuid-gem]/ensure: created |
Notice: /Stage[main]/Main/Package[uuid-yum]/ensure: created |
Notice: Applied catalog in 5.30 seconds
|
I'm going to close this as a dup of those. |