On Sunday, February 9, 2014 6:17:10 PM UTC-6, Felix Frank wrote: > > Hi, > > today I butted heads with yet another cron issue [1] that was caused by > the fact that the cron type specifies a default value for the user > property. It made me think of a fundamental issue I had jotted down some > time ago in a gist [2]. > > I propose that default values for properties are dangerous, at least in > the way they work right now. What happens is that a manifest that does > not specify a value for a property that has a default value leads to a > catalog with this default as the should-value for that property. See the > gist for an example. Puppet will mercilessly sync systems to the default > values. > > As far as I can tell, the defaults are only necessary for cases in which > ensure changes from absent to present (or another non-absent value, for > some types). Would it make sense to try and limit their use to exactly > those times? > >
Well, almost everywhere that a type does not require a parameter or property to be explicitly declared, there has to be at least a *de facto*default that is used if the resource must be transitioned from absent to some form of present. After that, however, it is a general, longstanding Puppet principle that Puppet only manages the details of target nodes that you instruct it to manage (even if that principle is not universally followed). At minimum, then, I'd say that there need to be -- and to some extent there are -- defaults that apply only to resource creation. It does not necessarily follow that more broadly-scoped defaults are always poor practice, but after some reflection, I'm having difficulty coming up with satisfactory arguments against that proposition. John -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/0c5c09a7-ba00-4232-9753-ab96ff1025b8%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
