[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [Puppet Users] 2 package resources for the same package installation in two differents modules caused errors Miguel Di Ciurcio Filho Tue Apr 03 14:00:20 2012

On Tue, Apr 3, 2012 at 3:33 PM, Christophe L <[EMAIL PROTECTED]> wrote:
> Hello,
> We had the following situation where including two classes that were
> ensuring the installation of the same package "php5-imagick" and it
> was causing an error indicating that two ressources of the same name
> are forbidden (sorry, I don't have the exact message error since we
> fixed quickly the error).

By the nature of the Puppet's language, resources must have a unique
title and must have only one definition.

Quoting http://docs.puppetlabs.com/guides/language_guide.html#resources:

"The field before the colon is the resource’s title, which must be
unique and can be used to refer to the resource in other parts of the
Puppet configuration."

> Code causing the error:
> /etc/puppet/modules/apache/manifests/init.pp
> class apache::install {
>  ...
>  package { [ "php5", "php5-cli", "php5-gd", "php5-imagick", "php5-
> mysql", "phpmyadmin", "mysql-client" ]:
>        ensure => installed,
>  }

The line above is just a shortcut to this something like this:

package {"php5": .... }
package {"php5-cli": .... }
package {"php5-imagick": .... }

So when Puppet compiles all your manifests, there can be only one
php5-imagick, in your case.

You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at