On Fri, Dec 17, 2010 at 07:46:29AM -0800, luke.bigum wrote:
> Nigel's Virtual Resources is one way, this is another using only
> classes.
> 
> You can put the base software in classes of their own and include
> these in your 'server classes'. Classes can be included multiple times
> on a node without causing errors.

Hm personally, I don't really like that because you can include the class in
different scopes:

One example:

  class common {
    file { '/tmp/test':
      content => $tempvar,
      ensure  => file,
    }
  }
  class foo {
    $tempvar = "foo"
    include common
  }
  class bar {
    $tempvar = "bar"
    include common
  }
  node default {
    include foo
    include bar
  }

This does not throw a compile error but it really depends on ordering if
"foo" or "bar" will be in your file. If you define a virtual resource in
one place then everything depends on the scope where you defined that
resource and not where you realize it.

-Stefan

Attachment: pgp2WhnCwHqgE.pgp
Description: PGP signature

Reply via email to