On Tue, Oct 19, 2010 at 11:32:26AM +0200, Arnau Bria wrote: > I don't remember from where I took the idea... but seems that I chose > wrong place :-) What do you recommend me? any doc to follow?
Unfortunately, I don't think there is great documentation out there; the core development team is too busy and so are most of the users. Documentation lags behind. I'd love to add better documentation to Puppet but I have a very busy and stressful job, so I fail too. But in any case... > > the included class had better be in the file found by the > > autoloader). I hope that's a little clearer. > > Reading your answer (and if I thought a little more about it before), my > question > could be answered by myself. As you say import "inserts" code, so > having 2 diff defaults in 2 diff sites does not make much sense, or does not > behave as I wish. Great! Now that you understand better how imports and includes work, you're answering your own questions. I bet you can work out a better way of laying out your manifests for yourself. The best advice I can give you is to work with the way puppet module/class autoloading works, not against it. > > If I redefine File defaults in comuting_bacula (in the class, not > module) it's evaluted and it's more important: > > class computing_bacula { > File { mode => 755 } > } > File { 'kaka' } > > on client: > notice: /Stage[main]/Computing_bacula/File[kaka]/mode: mode changed '666' to > '755' > > > So class defaults "are more important" than site dfaults. If there is a conflict between an already declared default and a new default, the new default wins. If there is no conflict, they are added together. If you go back to my example, I set a default of "ensure = file" at the top level. Because none of the later defaults had an "ensure" parameter, all files inherited that default. I also set "mode = 750" at the top level, but in some places I later declared "mode" again. In such cases, the declaration in the most immediate scope always wins. -- Bruce What would Edward Woodward do?
signature.asc
Description: Digital signature