5

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?

Atmesh Mishra
  • 527
  • 10
  • 26

1 Answers1

8

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,
}
Matthew Schuchard
  • 25,172
  • 3
  • 47
  • 67