puppetlabs/puppet — pull request #2678 by relud (2014-05-20 21:51:53+00:00)
Title: Accept module paths in Puppet::Parser::Function.file()

Summary
---

This modifies the file() function to accept module paths (like the template() function) as well as fully qualified paths.

Example
---
with directory structure:

/etc/puppet/modules/example
├── files
│ └──file.ext
├── manifests
│ └──init.pp
└── templates
└──template.erb

When the module path for files can be used instead of the absolute path:

file('example/file.ext') returns the same as file('/etc/puppet/modules/example/files/file.ext').

This is supposed to be like how template does module paths, where:

template('example/template.erb') returns the same as template('/etc/puppet/modules/example/templates/template.erb')

Why
---

This would make it possible for modules that use the file() function to be more portable, instead of being tied to a specific puppet server configuration.