Brilliant, thanks Luke.

Just for the benefit of any future google-searchers, here's a fixed
version of my previous pseudocode that actually works, and
demonstrates this behaviour. A combination include+require function,
as per 0.25, will neaten this up nicely.

class a {
 # no guarantee as to which of these is created first
  file{"/tmp/x":ensure=>present}
  file{"/tmp/y":ensure=>present}
}

class b {
  include a
  # /tmp/x and /tmp/y are guaranteed to exist before /tmp/z
  file{"/tmp/z":
    ensure=>present,
    require=> Class["a"]
  }
}
node my_pc {
  include b
}

On May 20, 5:09 pm, Luke Kanies <l...@madstop.com> wrote:
> On May 18, 2009, at 10:04 AM, Chris wrote:
>
>
>
>
>
> > Hi all,
>
> > Prompted by Evan's question about requiring classes between modules; I
> > wonder if someone could clarify my understanding of how this works: If
> > I have
>
> > Class a {
> > some_resource{x:}
> > some_resource{y:}
> > }
>
> > Class b {
> > some_resource{z:
> >  require Class[a]
> > }
> > }
>
> > Does this mean that puppet will ensure that some_resource{x:} and
> > some_resource{y:} have been successfully applied before it tries to
> > apply some_resource{z:} ? Or is it equivalent to doing "include a"
> > i.e. all the resources are applied, but in no particular order ?
>
> The former is correct - class dependencies ensure that all resources  
> in the required class are applied before *any* resources in the  
> requiring class.
>
> 0.25 has a 'require' function that behaves like include + class require.
>
> --
> Never interrupt your enemy when he is making a mistake.
>      --Napolean Bonaparte
> ---------------------------------------------------------------------
> Luke Kanies |http://reductivelabs.com|http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
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