Hi,

https://puppet.com/blog/class-containment-puppet

I'd say
1.- one module for you stuuf (moduleA)
2.- one file per class
3.-) one class that "contain" the others and set order.

moduleA/class1.pp
class moduleA::class1 { }

moduleA/class2.pp
class moduleA::class2 { }

moduleaA/class3.pp
class moduleA::class3 { }


moduleA/init.pp
contain moduelA::class1
contain moduelA::class2
contain moduelA::class3

Class['moduelA::class1'] ->
Class['moduelA::class2'] ->
Class['moduelA::class3']


HTH,
Arnau

2017-05-24 17:57 GMT+02:00 Harish Kothuri <harishkoth...@gmail.com>:

> 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 puppet-users+unsubscr...@googlegroups.com.
> 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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAM69jx8nbaraMUNv9cmR24Xtenjx%3DKmWzVk4%2BCPLC-t1BJcPJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to