Re: [Puppet Users] addition to wiki/FunctionReference

Peter Meier
Tue, 08 Dec 2009 11:00:08 -0000

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

hmm, I''m not sure whether it is now even more misleading than before.
The point with function is that they are evaluated at compile time and
as compilation happens on the master it will also only see things on
the master.
So your example is so far only working if you either run puppet as
standalone app or you are talking about a file resource which will get
applied on the master.
Everything else won''t work.
In general your explanation is correct, but I think maybe it is
misleading for some people, as many people don''t understand at first
why functions are only evaluated on the master.

I think it''s good to extend the function explanation, there is also
some part in the language tutorial:
http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#functions
Maybe we should simply put the warning in the FunctionReference as
well and redirect for further information to the LanguageTutorial
where people can extend the documentation how they would like to
extend it.
So imho your explanation would fit better there.

thanks and cheers pete