On 09.12.2009 16:28, jcbollinger wrote: > As far as I know, overriding only works in a subclass, so it would > need to be: > > class stripdown inherits mysql::server { > Service { "mysqld": enable => "false", ensure => "stopped" } > } > > > Obviously, that's messy and it doesn't scale for multiple overrides. > It may also have other, unwanted effects. >
Yep, sorry I've had some bad concepts about overriding. Sorry for posting bad stuff on the list. Testing on a 0.25.1 I got to this class s_test1::stripdown { service { "mysqld": name => "mysql", enable => false, ensure => stopped, } #other definitions that make sure that the service is not working } class s_test1::client inherits s_test1::stripdown { #definition overrides to install the client part } class s_test1::server inherits s_test1::client { #if this is the server the client part should be also included #that's why we inherit from s_test1::client #overrides definitions Service ["mysqld"] { enable => true, ensure => running } } of course you should create a class stripdown which includes stripdown for each service you want. I think this is the usual style of defining stuff in puppet as I've seen it in a lot of places. Now if you include both s_test1::stripdown and s_test::server server will take precedence. (actually it may start as s_test1::stripdown and then "add to it" s_test1::server, but the behavior is respected no matter what the order of includes). Silviu -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@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.