that's is an interesting example. If we actually did implement futures in
puppet, I would expect that to result in an error.

On Tue, Nov 23, 2010 at 12:07 PM, Stefan Schulte <
stefan.schu...@taunusstein.net> wrote:

> On Tue, Nov 23, 2010 at 11:27:58AM -0800, Dan Bode wrote:
> > Hi,
> >
> > On Tue, Nov 23, 2010 at 11:21 AM, Alaric <paxindust...@gmail.com> wrote:
> >
> > > Hi all!  I've been trying to work with classes in my templates, it
> seems
> > > like a really useful feature.  I'm running on puppet .25.5 from EPEL
> and
> > > really wanted to start making use of the ability to pivot on classes
> that
> > > have been included in the catalog.  It *seems* as though the templates
> are
> > > only cognecent of defined classes  that precede the included module in
> the
> > > site.pp file.   Is that the expected behavior?  For my testing I used
> the
> > > example code on the wiki, and is included in the site_syslog module
> > >
> > > <% classes.each do |klass| -%>
> > > # The class <%= klass %> is defined
> > > <% end -%>
> >
> > This is unfortunately true. It's possible that this may work in a future
> > version.
>
> I think thats near to impossible. What if I do something like
>
> $number_of_classes = inline_template(<%= classes.size)
> if ($number_of_classes > 10) {
>  include class_not_previously_included
> }
>
> what should the value of $number_of_classes be. Should it take
> class_not_previously_included into account? And what if the number of
> included classes without class_not_previously_included is exactly 10.
> Then not including whould be right (because we than have 10 classes
> included so we dont need the extra one) and including whould be right at
> the same time (because whould then have 11 classes included). And now
> image I would say
> if ($number_of_classes < 10) { include foobar } and with foobar included
> it whould be exactly 10.
>
> -Stefan
>

-- 
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.

Reply via email to