Re: [Puppet Users] Duplicate declaration error

2018-06-08 Thread Priyo Phan
I think it is due to the Apache class being called inside your defined
type, it is being called more than once when you try to create more than 1
vhost.

On Fri, Jun 8, 2018, 15:40 Clemens Bergmann  wrote:

> Hi There,
>
> I have a "can not redeclare" error that I do not understand.
>
> I try to write my own apache::vhost defined type with sane defaults for my
> environment.
>
> The general class layout is as follows:
>
> class vhost::vhost1 {
> custom::apache::vhost{
>#parameters
>  }
> }
> class vhost::vhost2 {
>  custom::apache::vhost{
>#parameters
>  }
> }
> define custom::apache::vhost () {
>  include custom::apache
> }
> class custom::apache {
>  class { '::apache':
>#parameters
>  }
>  class { '::apache::mod::ssl':
>#parameters
>  }
>  include apache::mod::authnz_ldap
>  include apache::mod::headers
>  include apache::mod::rewrite
>  include apache::mod::fastcgi
>  apache::listen { '443': }
> }
>
>
>
> When I define only one custom::vhost then everything works fine.
> But when I define multiple custom::vhost then I get the error "Duplicate
> declaration: Class[Apache] is already declared;" which refers to the line
> in class "custom::apache" where the "class { '::apache':" is defined.
>
> Can someone explain to me why I get this error?
>
> Thanks.
> Clemens
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/045a13d7-7bf0-4523-9067-8bbf73c26c89%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CADZKzzbdn%3DrdydkFY7s3F%3DCRgFWzQ2LJ0TfR2dwBGm97o5m8xQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Duplicate declaration error

2018-06-08 Thread Clemens Bergmann
Hi There,

I have a "can not redeclare" error that I do not understand.

I try to write my own apache::vhost defined type with sane defaults for my 
environment.

The general class layout is as follows:

class vhost::vhost1 {
custom::apache::vhost{
   #parameters
 }
}
class vhost::vhost2 {
 custom::apache::vhost{
   #parameters
 }
}
define custom::apache::vhost () {
 include custom::apache
}
class custom::apache {
 class { '::apache':
   #parameters
 }
 class { '::apache::mod::ssl':
   #parameters
 }
 include apache::mod::authnz_ldap
 include apache::mod::headers
 include apache::mod::rewrite
 include apache::mod::fastcgi
 apache::listen { '443': }
}



When I define only one custom::vhost then everything works fine.
But when I define multiple custom::vhost then I get the error "Duplicate 
declaration: Class[Apache] is already declared;" which refers to the line 
in class "custom::apache" where the "class { '::apache':" is defined.

Can someone explain to me why I get this error?

Thanks.
Clemens

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/045a13d7-7bf0-4523-9067-8bbf73c26c89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Duplicate declaration error - what's the correct approach to avoid this?

2017-11-24 Thread Dirk Heinrichs
Am 23.11.2017 um 15:47 schrieb buoyant_puppy:
> That's is a simplified version of my actual use case:
>   $mythings.each | String $x | {    # for each x in list 'mythings'
>     notify { "gonna do something with $x": }
>   

Not sure, but I think you need to use ${x} in the resource declaration
to actually have the variable interpolated.

HTH...

    Dirk
-- 
*Dirk Heinrichs*
Senior Systems Engineer, Delivery Pipeline
OpenText^TM Discovery | Recommind
*Email*: dirk.heinri...@recommind.com 
*Website*: www.recommind.de 

Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach

Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon
Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer
HRB 10646

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9022423f-007b-a7a8-a615-98686e8721e7%40opentext.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Duplicate declaration error - what's the correct approach to avoid this?

2017-11-23 Thread Dirk Heinrichs
Am 23.11.2017 um 15:47 schrieb buoyant_puppy:
> That's is a simplified version of my actual use case:
>   $mythings.each | String $x | {    # for each x in list 'mythings'
>     notify { "gonna do something with $x": }
>   

Not sure, but I think you need to use ${x} in the resource declaration
to actually have the variable interpolated.

HTH...

    Dirk
-- 
*Dirk Heinrichs*
Senior Systems Engineer, Delivery Pipeline
OpenText^TM Discovery | Recommind
*Email*: dirk.heinri...@recommind.com 
*Website*: www.recommind.de 

Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach

Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon
Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer
HRB 10646

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0ff870ae-131f-a044-9565-744f54224fbe%40opentext.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Duplicate declaration error - what's the correct approach to avoid this?

2017-11-23 Thread buoyant_puppy
Why does this:  
  class mymodule {
notify { "booboo": }
notify { "booboo": }

provoke the error:
  Error while evaluating a Resource Statement, Duplicate declaration: 
Notify[booboo] is already declared in file 

That's is a simplified version of my actual use case:
  $mythings.each | String $x | {# for each x in list 'mythings'
notify { "gonna do something with $x": }
  

In plain english, for example, I may have a list of rpms and want to loop 
through them to ensure all are installed.

What would be the correct way to do this, if not the above?


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8b3de960-9f07-403e-838b-1b44409539fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.