Hi Harish,
import is deprecated in Puppet 4!
You can use require:
class 3 {
require class1
require class2
…
}
Best,
Martin
> On 24 May 2017, at 17:57, Harish Kothuri <[email protected]> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/5e5d0f57-5df3-43f5-8d96-48896ed258b2%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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/C77D5382-0B73-44B9-831B-D71699ECA317%40gmail.com.
For more options, visit https://groups.google.com/d/optout.