On Sat, Dec 18, 2010 at 11:46:50AM -0800, Ken Barber wrote:
> Can you elaborate?
> 
> On Saturday, December 18, 2010 7:23:57 PM UTC, kc7zzv wrote:
> >
> >
> > On Dec 18, 2010, at 3:50 AM, Ken Barber wrote:
> >
> > > For the record, an alternative that I don't believe was mentioned is to 
> > do something like:
> > > 
> > > if !defined(Package["foo"]) {
> > >   package {"foo": ensure => installed }
> > > }
> >
> > In general this is a bad idea though.  Mostly because it can surprise you 
> > in bad ways.
> >
> >

Its an ordering issue. Example

  node default {
    include foo
    if defined(Exec['uname']) {
      include bar
    }
  }

  class foo {
    exec { 'uname': command => '/usr/bin/uname' }
    notice("Class[foo] applied for defaultnode")
  }
  class bar {
    notice("Class[bar] applied for defaultnode")
  }

This works but if you include foo after the ifstatement then bar will
not be included. If you have a complex dependency chain the right order
may not be as obvious as in this example (at least I dont know in which
order puppet parses complex and nested class structures [and in my
opinion I should not have to know it])

-Stefan

Attachment: pgpKjJX0SnTv9.pgp
Description: PGP signature

Reply via email to