you can put the package resource in a single class, and include this class
in app[1-3],  alternatively, try virtual resources, see:
http://docs.puppetlabs.com/guides/virtual_resources.html

On Mon, Mar 19, 2012 at 9:15 AM, EmmEff <mike...@gmail.com> wrote:

> How to handle this scenario?
>
> Assume that all three apps are defined in three separate modules.  All
> three modules are mutually exclusive with the exception that they require
> the same packageA to be installed.
>
> Pseudocode:
>
> class module1::app1 {
>   package {
>     'packageA':
>       ;
>   }
> }
>
> class module2::app2 {
>   package {
>     'packageA':
>       ;
>   }
> }
>
> class module3::app3 {
>   package {
>     'packageA':
>       ;
>   }
> }
>
> -- site.pp
>
> node 'mynode.example.com' {
>   include module1::app1
>   include module2::app2
>   include module3::app3
> }
>
> This will give me an error that packageA is already defined in another
> file.  I *know* I'm missing something simple, but what is it?  How can I
> avoid this situation of the duplicate package definitions while ensuring
> the resource Package['packageA'] is created?
>
> I tried the following but I guess I'm not understanding the defined()
> function properly:
>
> class module1::app1 {
>   if ! defined(Package['packageA']) {
>     package {
>       'packageA':
>         ;
>     }
>   }
> }
>
> Forgive me if this is an oft asked question.  I couldn't figure out the
> search term that made sense that would match this scenario.  TIA
>
> Mike.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/Q5kdE6TkzGYJ.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to