Thanks for the responses. My example is just an example. My real "define" has some parameters so it's not possible to use a class.
Here is the same problem by another Puppet user: http://www.mail-archive.com/puppet-users@googlegroups.com/msg06262.html 2010/1/11 jcbollinger <john.bollin...@stjude.org>: > > On Jan 11, 6:03 am, Sébastien Prud'homme > <sebastien.prudho...@gmail.com> wrote: >> Does someone know if it's a bug or if i'm doing things the wrong way? > > As Sliviu explained, you're doing things the wrong way. What he gave > you resolve your errors, but it is focused on how to get the virtual > package declaration to work. Depending on what you're trying to > accomplish, however, a virtual declaration may be a sub-optimal > approach to begin with. > > I'm inferring that you want a define that may be called multiple > times, with every invocation needing to declare the same one resource > (among other things). In Puppet, you can achieve this directly with > classes -- involving virtual resources only complicates matters. > Thus, within the limited scope of the example, this solution will > achieve exactly the same result (effect of mydefine2) as Sliviu's > example: > > class clspackage { > package { postfix: } > } > > define mydefine1 { > include clspackage > } > > define mydefine2 { > mydefine1 { $name: } > } > > In general, although virtual resources seem cool, they don't do as > much as Puppet newcomers seem to think they do. I'm unaware of any > problem whose solution *requires* their use, and people seem inclined > to apply them to situations where they aren't helpful. YMMV. > > > John > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-us...@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-us...@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.