* Ahmed El Gamil <ahmed at manhag.org> [2010/08/18 17:17]:
> I was working on some puppet recipe and came to the need where i
> want to download a file from an HTTP server, usually i use the
> "file" resource type with the "source" parameter to push files to
> the clients, but in this situation i just need to download the
> file directly from the HTTP server to the puppet client.
> 
> By any chance, does the "source" parameter supports HTTP URLs, if
> not then how can i do that in Puppet ?

I use a simple define + wget for this kind of thing:

  define download ($uri, $timeout = 300) {
      exec {
          "download $uri":
              command => "wget -q '$uri' -O $name",
              creates => $name,
              timeout => $timeout,
              require => Package[ "wget" ],
      }
  }

Use it like:

  download {
      "/tmp/tomcat.tar.gz":
          uri => 
"http://www.ibiblio.org/pub/mirrors/apache/tomcat/tomcat-5/v5.5.30/bin/apache-tomcat-5.5.30.tar.gz";,
          timeout => 900;
  }

-- 
It's a damn poor mind that can only think of one way to spell a word.

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

Reply via email to