On Sep 27, 2010, at 7:04 AM, Brice Figureau wrote: > Hi, > > It looks like I missed your original e-mail to puppet-dev. > > On Fri, 2010-09-24 at 11:20 -0700, Nigel Kersten wrote: >> [cross-posting as I'd like to know whether my intuition about this >> being the most common case is correct] >> >> >> class foo { >> >> file { "/etc/foo.conf": >> source => "puppet:///modules/foo/foo.conf", >> } >> >> } >> >> For me, every single one of my source specifications refers to a file >> inside the current module. My intuition is that this is the most >> common case outside my own deployment, so why don't we optimize for >> it? >> >> class foo { >> >> file { "/etc/foo.conf": >> source => "foo.conf", >> } >> >> } >> >> eg the proposal is that if you don't specify the protocol, server >> address, modules prefix, module name, it is assumed you are referring >> to a file path relative to the 'files' subdirectory of the current >> module. >> >> If you wish to fully specify the source URI, you're free to do so. > > My issue with your proposal is that at first glance it will look like a > local copy (which should require an absolute path) and not a remote > copy. This certainly violate the least surprise paradigm for new users. > > What about a new URI scheme (ie module) which would do the same: > > class foo { > file { "/etc/foo.conf": > source => "module://foo.conf", > } > }
Another option is a new function: class foo { file { "/etc/foo.conf": source => expand("foo.conf") } } Then all of the smarts could be in expand(). OTOH, I think it's a bit think in terms of syntax. Backticks? :) -- Everything that is really great and inspiring is created by the individual who can labor in freedom. -- Albert Einstein --------------------------------------------------------------------- Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199 -- 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.