On Dec 17, 2010, at 9:45 PM, Erwin Bolwidt wrote: > Hi, > > When I use an exec resource to create a file, a timeout may occur. As an > example, I can run wget to get a file (not the most elegant solution but > necessary sometimes), or run some other program that depends on the network > to get some data that is necessary to create the file. > > This timeout itself is fine, I could increase the timeout, but there are > still cases where I would want puppet to stop after this timeout. > > Problem is, what if the file was partially created? I use an exec resource > with the creates attribute, so the next time puppet runs, it thinks that the > exec resource has been satisfied, and it doesn't run the command again.
What I do is have the second command's completion condition used as the condition for the first exec. Then I make sure the first exec will properly handle a partially downloaded file. The one time this isn't easy, I embedded the whole thing in a shellscript that moves the completed file to the right location at the end. I personally use zsync a bit since I can use the old file to speed up the downloading when the file changes. -- 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.