You should have 'return sources', 'sources', or just leave that bit off,
since 'sources << "puppet:///files/common/#{filename}"' will return the
value of sources.
--
Jacob Helwig
In general more desirable to be explicit about the file you are
distributing rather than using this pattern. Moving on to the issue.
> I've created a custom function to return the generated array similar
> to the following:
>
> file: { "some_file":
> source => find_file(path),
> ...
> }
Function seems fine:
notice: Scope(Class[main]): puppet:///files/puppet/file.txt
puppet:///files/my_role//file.txt puppet:///files/my_role/file.txt
puppet:///files/common/file.txt
notice: Finished catalog run in 0.02 seconds
file: { ... should be file { "some_file": ...
Are you using path as a variable instead of the actual file path?
file { "some_file":
source => find_file("/path/to/file"),
...
}
HTH,
Nan