Re: [Puppet Users] addition to wiki/FunctionReference

Andrew Schulman
Tue, 08 Dec 2009 11:09:47 -0000

> On 08.12.2009 11:31, Andrew Schulman wrote:
> > I added some text to
> > http://reductivelabs.com/trac/puppet/wiki/FunctionReference.  It
explains that
> > functions get evaluated at compile time, before execution time, and
that this
> > matters if you''re using functions whose values depend on the
results of your
> > manifests.
> >
> >
http://reductivelabs.com/trac/puppet/wiki/FunctionReference?action=diff&version=26&old_version=25
> >
> > I''d appreciate it if someone would check the accuracy of what
I wrote, and if
> > it''s deemed to be accurate and useful, apply it upstream so
that it will stay in
> > the wiki.
>
>
> Not quite: The functions are actually evaluated on the server. You
> example of using file($path) and file { $path: ... } will never work,
> since the file() function will read $path on the puppetmaster, while the
> File[$path] resource will manage $path on the client.

Well, not never.  It works if it''s run on the puppetmaster, which is
the case I
actually was thinking of and where I first encountered the problem.
It''s also
the case if you run a puppet script standalone with /usr/bin/puppet.

But you''re right of course that the statement needs to be make clear
that
functions are evaluated on the puppetmaster.  I''ll think on that.

Thanks,
Andrew.