Method: Puppet::Parser::Files.find_file
- Defined in:
- lib/puppet/parser/files.rb
.find_file(file, environment) ⇒ String?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Find the path to the given file selector. Files can be selected in one of two ways:
* absolute path: the path is simply returned
* modulename/filename selector: a file is found in the file directory
of the named module.
The check for file existence is performed on the node compiling the manifest. A node running “puppet apply” compiles its own manifest, but a node running “puppet agent” depends on the configured puppetserver for compiling. In either case, a nil is returned if no file is found.
42 43 44 45 46 |
# File 'lib/puppet/parser/files.rb', line 42 def find_file(file, environment) find_in_module(file, environment) do |mod, module_file| mod.file(module_file) end end |