On Thu, Oct 11, 2012 at 3:26 PM, R.I.Pienaar <r...@devco.net> wrote:

>
>
> ----- Original Message -----
> > From: "Mohit Chawla" <mohit.chawla.bin...@gmail.com>
> > To: puppet-users@googlegroups.com
> > Sent: Thursday, October 11, 2012 11:19:48 PM
> > Subject: Re: [Puppet Users] Re: Wrapper classes, ordering & anchors
> >
> > Hi, it works with code like in your paste. But check this out :
> > http://pastie.org/5037832, the original situation I found myself in,
> > and you can see the "floating off" behaviour again.
> >
>
> yes, our method does not constrain the left of the relationship
> only the right - ie. classes before the wrapper class but at any
> time before the wrapper class
>
> if you then insert another class before the wrapper you dont have
> a guarantee where in the graph it gets inserted.
>
> In this specific case you could just swap the chain around putting
> the classes after the wrapper
>
> Class["wrapper"] -> Class["three"] -> Class["two"] -> Class["one"]
>
> or whatever.
>
> The difference between the two is:
>
> for the anchor pattern as per Jeff:
>
> <before anchor> classes <after anchor>
>
> the simpler one:
>
> classes <wrapper as anchor>
>
> or
>
> <wrapper as anchor> classes
>
> its less strict and I prefer this because if you're overdoing
> the require hints you're just really turning puppet into a bash
> script


Yeah, but sometimes the need to manage both sides of the wrapper class is
un-avoidable.  I often find this to be the case when I'm dealing with
interpreter packages like java, ruby, perl, python, etc...  The classes
that setup the packaging repositories need to happen before the class
managing the ruby / java / python / go / whatever interpreter... and the
classes that actually manage your application need to come after the class
that manages the interpreter.

So the interpreters are what is modeled in the "wrapper" class in this
discussion.

This pattern is necessary in other situations too; web servers that host
applications for example.  Basically, I think to myself, "I may need to
anchor down this class..." if the thing the class is modeling sits between
the infrastructure layer and the application layer.

So, not quite as common as a bash script, but not so uncommon that you
never need to use it.

Again, the fact that it's necessary at all is definitely a bug in Puppet.
 We just haven't fixed it yet, but not for lack of people trying.  =(

-Jeff

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