Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Puppet code to download extract and install

Tags:

puppet

I have a file at some web URL (http://www.somewhere.com/something.tar.gz). This is direct download link. I need a puppet code that would download this file, extract it and install the file.

Can we do this using package {} in puppet?

like image 521
Atmesh Mishra Avatar asked Mar 12 '23 12:03

Atmesh Mishra


1 Answers

There isn't really an intrinsic provider for the package type that understands tarballs. There is, however, this VoxPopuli module: https://forge.puppet.com/puppet/archive which was recently Puppet certified and should do what you need.

Note under their usage example it could be modified for your needs like:

archive { '/tmp/something':
  ensure        => present,
  extract       => true,
  extract_path  => '/tmp',
  source        => 'http://www.somewhere.com/something.tar.gz',
  checksum      => 'checksum hash',
  checksum_type => 'sha1',
  creates       => '/tmp/something',
  cleanup       => true,
}
like image 189
Matt Schuchard Avatar answered Mar 19 '23 20:03

Matt Schuchard