How about deprecating defined?(Type['title']), but allowing it to accept a resource hash? This would definitely satisfy my use cases while alleviating concerns about resource attribute conflicts/parse order dependencies
if defined?( { package['foo'] => { ensure => present } } ) { package { 'foo': ensure => present } } On Fri, Jan 20, 2012 at 1:00 AM, Dan Bode <d...@puppetlabs.com> wrote: > I wind up using defined more than I should probably admit. yes it is > dangerous/confusing b/c of parse order dependencies, but it is also really > useful for a few use cases > > * static resources in a defined resource type (avoids having to use > classes to store all static dependencies) > > * the big reason I keep on leaning on it is for package dependencies. > Often something needs an additional package installed (and it is possible > that other modules may have that same package dependency, and I don't want > to have to create a new class every time that I need another package > (especially for something complicated that may have tons of package > dependencies) > > puppet-apt has a relevant pull request where someone wants to wrap a > defined? around python-software-properties for this exact reason > > https://github.com/puppetlabs/puppet-apt/pull/10 > > > On Thu, Jan 19, 2012 at 9:18 AM, Nigel Kersten <ni...@puppetlabs.com>wrote: > >> I'm looking for strong opinions on whether we should or shouldn't >> deprecate the defined() function for Telly, the next major Puppet release >> this year. >> >> jcbollinger put it quite well in another thread: >> >> "Use of the "defined" function introduces a parse-order dependency, and >> the additional work you need to do to ensure that that dependency is always >> fulfilled overcomes any simplicity advantage that might otherwise exist." >> >> >> >> -- >> Nigel Kersten >> Product Manager, Puppet Labs >> >> >> -- >> 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. >> > > -- 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.