On Fri, Oct 7, 2011 at 6:50 AM, Nate <nathan.schum...@gmail.com> wrote:
> Hi,
>
> I'm trying create a custom function that will return an array of file
> paths for the file type source.  Instead of defining the following
> array for source for each file type:
>
> file: { "some_file":
>  source => [ "puppet:///file/$hostname/path", "puppet:///file/$role/
> $mode/path", "puppet:///file/$role/path", "puppet:///file/common/
> path", ],
>  ...
> }

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

-- 
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.

Reply via email to