Re: [Puppet Users] addition to wiki/FunctionReference

2009-12-09 Thread Thomas Bellman
Andrew Schulman wrote:

 To me it seems like more specialized material that should go in the reference
 rather than the tutorial.  But wherever it goes best is fine with me. 

Well, the Language Tutorial *is* the reference manual for the language.
There's no other document giving a more in-depth description of how
the Puppet language works.  (At least I haven't seen any.)


/Bellman

--

You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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.




Re: [Puppet Users] addition to wiki/FunctionReference

2009-12-08 Thread David Schmitt
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=diffversion=26old_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.


Regards, DavidS

--

You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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.




Re: [Puppet Users] addition to wiki/FunctionReference

2009-12-08 Thread Peter Meier
 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

--

You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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.




Re: [Puppet Users] addition to wiki/FunctionReference

2009-12-08 Thread Andrew Schulman
 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=diffversion=26old_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.

--

You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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.




Re: [Puppet Users] addition to wiki/FunctionReference

2009-12-08 Thread Andrew Schulman
  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.

Agreed-- see my answer to David.  I've backed it out for now and will rework it.

 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.

To me it seems like more specialized material that should go in the reference
rather than the tutorial.  But wherever it goes best is fine with me. 

Thanks for your comments.
Andrew.

--

You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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.




Re: [Puppet Users] addition to wiki/FunctionReference

2009-12-08 Thread James Turnbull
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew

I don't know your background but have you considered cloning the git
repo and directly editing the reference source and submitting
patches?  That way it's straight upstream and you get credit for the
update.

You can find some instructions at:

http://reductivelabs.com/trac/puppet/wiki/Development/DevelopmentLifecycle

Cheers

James Turnbull

- --
Author of:
* Pro Linux System Administration (http://tinyurl.com/linuxadmin)
* Pulling Strings with Puppet (http://tinyurl.com/pupbook)
* Pro Nagios 2.0 (http://tinyurl.com/pronagios)
* Hardening Linux (http://tinyurl.com/hardeninglinux)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEVAwUBSx49XiFa/lDkFHAyAQKiBAgAov6VP0SNg3DqpF2I2lFQjcyPHc8Z1ITu
w1GahuFuK83BhxjpZaCtznJrMAcAYqDRZ58rRjqF7tQ9iXoee2UfZuHFfSvdgPtw
kvJCKIehvxrku18nlWNdw9ECgWO4crrFMbmdoMQ8zu5Ww0/NwKtTA/1r0kgjycA0
ER26TDyL1RdIyBLuoOnmQYN6hhIFKicEnJ35Gv/Ihou9cMSKOpRt/LxznGaVuxkE
bLbgWLt4uOuwUMkVYtKhuZ5CimSBvm2ZCRKEUWXeDLe2huI+KWJS06E238AChPYk
UqS20AVJL7qlkjW25945ZbzwlAsmwYfMuvvtW7srNSwQMA9WQIvUBg==
=UWN9
-END PGP SIGNATURE-

--

You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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.




Re: [Puppet Users] addition to wiki/FunctionReference

2009-12-08 Thread Andrew Schulman
 I don't know your background but have you considered cloning the git
 repo and directly editing the reference source and submitting
 patches?  That way it's straight upstream and you get credit for the
 update.
 
 You can find some instructions at:
 
 http://reductivelabs.com/trac/puppet/wiki/Development/DevelopmentLifecycle

Thanks.  I'm a bzr guy, but I'll see about getting up to speed with git.

--

You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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.