You need to use 'require' instead of 'import'.

On 5/24/2017 11:57 AM, 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*
*
*
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] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/5e5d0f57-5df3-43f5-8d96-48896ed258b2%40googlegroups.com <https://groups.google.com/d/msgid/puppet-users/5e5d0f57-5df3-43f5-8d96-48896ed258b2%40googlegroups.com?utm_medium=email&utm_source=footer>.
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/851bb3e1-774c-9584-62a2-5518bf6bc5ee%40alter3d.ca.
For more options, visit https://groups.google.com/d/optout.

Reply via email to