On Tue, Apr 3, 2012 at 3:33 PM, Christophe L <cl.subscript...@gmail.com> 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 puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to