I'm using Puppet 3.8.7 and "require" didn't work.
I could make it work with following
class1($version='1.1.1'){
include Class3
.
.
.before => [Class["Class3"]]
}
class2($version='2.2.2'){
include Class3
.
. .before => [Class["Class3"]]
}
and
class3()
{
exec{ 'something':
cmd => 'some command here',
}
}
On Wednesday, May 24, 2017 at 9:27:40 PM UTC+5:30, Harish Kothuri wrote:
>
> Hi,
>
> I have 3 classes and i need to execute class 3 only when class 1 and class
> 2 completes. All of these classes must be attached to a host.
>
> class1($version='1.1.1'){
> .
> .
> .
> }
> class2($version='2.2.2'){
> .
> .
> .
> }
>
> and
>
> class3(){
> import class1
> import class2
>
> exec{ 'something':
> cmd => 'some command here',
> before => [Class['class1'], Class['class2']]
> }
> }
>
> When i try to apply the above relation, i get the following error
>
> *Error: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Duplicate declaration: Class[class1] is already declared; cannot re
> declare on node machine.domain.com <http://machine.domain.com>*
>
> Can any one guide me how to handle this scenario?
>
> Thanks
>
>
>
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/d42e6665-b03c-4b8f-96a6-b65fb66314c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.