----- Original Message ----- > On Thu, Jan 6, 2011 at 12:29, Luc Suryo <[email protected]> wrote: > > > Is it possible to define a class say php-fpm that requires the class > > php to be called first? if so what s the syntax? > > Yes: package { "foo": require => Class["bar"] } > > I think Nigel just pointed out in another thread that this is, in > fact, our recommended way to do cross-module and cross-class > dependencies. I certainly do, because it means you can change the > implementation of the PHP stuff without peturbing the php-fpm module > at all.
I dont get it, if you have a number of inter dependent classes that you got somewhere, lets say the puppet forge, you'd want that class to have its own dependencies and requires between classes and such. You would then use the class syntax as above to supply parameters to configure these classes but you would really not want to use it to set relationships between classes. You should not need to know that php::foo is designed to run after php::install and php::configure, thats an implementation detail not a use case detail. You're in effect saying you can only supply the relationships in one place since this syntax can only be used once per node. So if you're recommending this as The Way then we'll end up with a bunch of classes downloaded from github and such with either no relationship or lacking the ability to pass in arguments for the class. This syntax - and externally specified dependencies - means you cant just look at the code and know what to expect. You cant just look at code you get given by teams and know the dependencies, requirements and such. If you're going to start using ENCs to do parametrized classes then everyone who wish to include a class need to know what relationships need to be set etc. We need to retain - and recommend, document and support - the way for classes to set relationships between classes. In this example that you are responding to - class php::foo that requires php - your suggestion is a bit weird. With your suggestion anyone who ever want to use this class need to know "when including php::foo you need to remember to set the requirement on foo" when in fact what you want is to include the foo::bar class and it should just behave in a sane way without any burden of documentation or everyone using it creating the dependencies tree. -- R.I.Pienaar -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
